Skip to content

feat(js-client-sdk): add ability to customize storage impl#1404

Merged
joker23 merged 2 commits into
mainfrom
skz/sdk-2428/browser-storage-override
Jun 1, 2026
Merged

feat(js-client-sdk): add ability to customize storage impl#1404
joker23 merged 2 commits into
mainfrom
skz/sdk-2428/browser-storage-override

Conversation

@joker23

@joker23 joker23 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

This PR will enable browser sdk to take in a custom storage implementation.

Additional details:

  • added common implementation for client sdks to eventually to make this feature common to all js client sdks
  • custom storage implementations will be wrapped to ensure they don't throw

Note

Low Risk
Optional API with safe wrapper; default persistence path is unchanged when storage is not set.

Overview
Adds an optional storage setting on the browser (and React client) SDK so apps can plug in their own persistence instead of window.localStorage, while keeping today’s default when the option is omitted.

Shared client code introduces the LDStorage contract (get / set / clear) and createSafeStorage, which adapts custom implementations to the internal storage API: failures are logged, reads return null, and writes are dropped so a bad implementation cannot take down the host app. The browser client validates storage, wraps it with createSafeStorage, and passes it into BrowserPlatform, which uses the override when provided and otherwise still chooses LocalStorage only when supported.

Reviewed by Cursor Bugbot for commit a1f4117. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 26389 bytes
Compressed size limit: 29000
Uncompressed size: 129320 bytes

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 38768 bytes
Compressed size limit: 39000
Uncompressed size: 212567 bytes

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 179554 bytes
Compressed size limit: 200000
Uncompressed size: 831422 bytes

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 32002 bytes
Compressed size limit: 34000
Uncompressed size: 114243 bytes

@joker23

joker23 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 0b27576. Configure here.

@joker23 joker23 marked this pull request as ready for review June 1, 2026 17:56
@joker23 joker23 requested a review from a team as a code owner June 1, 2026 17:56

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@kinyoklion kinyoklion left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should extend the 'logs no warnings when all configuration is valid' test with storage like the RN equivalent test.

@joker23 joker23 merged commit 77864cb into main Jun 1, 2026
47 checks passed
@joker23 joker23 deleted the skz/sdk-2428/browser-storage-override branch June 1, 2026 22:45
@github-actions github-actions Bot mentioned this pull request Jun 1, 2026
joker23 pushed a commit that referenced this pull request Jun 2, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>browser: 0.1.25</summary>

##
[0.1.25](browser-v0.1.24...browser-v0.1.25)
(2026-06-01)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk bumped from 4.7.3 to 4.8.0
</details>

<details><summary>jest: 1.0.19</summary>

##
[1.0.19](jest-v1.0.18...jest-v1.0.19)
(2026-06-01)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/react-native-client-sdk bumped from ~10.17.7 to ~10.17.8
</details>

<details><summary>js-client-sdk: 4.8.0</summary>

##
[4.8.0](js-client-sdk-v4.7.3...js-client-sdk-v4.8.0)
(2026-06-01)


### Features

* **js-client-sdk:** add ability to customize storage impl
([#1404](#1404))
([77864cb](77864cb))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk-common bumped from 1.27.2 to 1.28.0
</details>

<details><summary>js-client-sdk-common: 1.28.0</summary>

##
[1.28.0](js-client-sdk-common-v1.27.2...js-client-sdk-common-v1.28.0)
(2026-06-01)


### Features

* **js-client-sdk:** add ability to customize storage impl
([#1404](#1404))
([77864cb](77864cb))
</details>

<details><summary>node-client-sdk: 0.0.2</summary>

##
[0.0.2](node-client-sdk-v0.0.1...node-client-sdk-v0.0.2)
(2026-06-01)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk-common bumped to 1.28.0
</details>

<details><summary>react-native-client-sdk: 10.17.8</summary>

##
[10.17.8](react-native-client-sdk-v10.17.7...react-native-client-sdk-v10.17.8)
(2026-06-01)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk-common bumped from 1.27.2 to 1.28.0
</details>

<details><summary>react-sdk: 4.1.0</summary>

##
[4.1.0](react-sdk-v4.0.5...react-sdk-v4.1.0)
(2026-06-01)


### Features

* **js-client-sdk:** add ability to customize storage impl
([#1404](#1404))
([77864cb](77864cb))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk bumped from ^4.7.3 to ^4.8.0
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> No application logic in the diff—only version manifests, changelogs,
and dependency pins from automated release tooling.
> 
> **Overview**
> This is a **Release Please** cut that publishes the already-merged
**customizable client storage** work from
[#1404](#1404). The diff
itself only bumps versions, updates `.release-please-manifest.json`,
refreshes changelogs, and aligns workspace dependency pins and
`x-release-please-version` stamps—no runtime source changes in this PR.
> 
> **`@launchdarkly/js-client-sdk-common` 1.28.0** is the functional
release (documented feature: pluggable storage).
**`@launchdarkly/js-client-sdk` 4.8.0** and **`@launchdarkly/react-sdk`
4.1.0** pick that up and note the same feature in their changelogs.
**React Native 10.17.8**, **combined browser 0.1.25**, **node-client-sdk
0.0.2**, and **jest tooling 1.0.19** are dependency-driven patch/minor
bumps. Examples and internal packages are updated to the new SDK
versions.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
87c075f. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants