Skip to content

feat: initial localStorage provider#1518

Open
MattIPv4 wants to merge 5 commits intoopen-feature:mainfrom
MattIPv4:MattIPv4/localstorage-provider
Open

feat: initial localStorage provider#1518
MattIPv4 wants to merge 5 commits intoopen-feature:mainfrom
MattIPv4:MattIPv4/localstorage-provider

Conversation

@MattIPv4
Copy link
Copy Markdown
Member

@MattIPv4 MattIPv4 commented Apr 17, 2026

This PR

  • Introduces a new client provider based on values in localStorage

Notes

This is heavily based on the existing env var provider.

Follow-up Tasks

I think I'd like to ideally find a way for the provider to "reconcile" when changes are observed in localStorage (scoped to the prefix provided), so that flag values can update as localStorage updates rather than needing a page refresh. Can be a follow-up, though, not part of the initial implementation.

@github-actions github-actions bot requested review from beeme1mr and toddbaert April 17, 2026 18:22
@MattIPv4 MattIPv4 force-pushed the MattIPv4/localstorage-provider branch from a7454e4 to e015976 Compare April 17, 2026 18:24
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new LocalStorageProvider for the OpenFeature Web SDK, enabling feature flag overrides via the browser's local storage. The implementation includes comprehensive unit tests, documentation, and the necessary configuration for building and releasing the package. Feedback focuses on correcting a path mapping in tsconfig.base.json, fixing a mismatched method call in the unit tests, and improving SSR safety by checking for the existence of localStorage before access.

Comment thread tsconfig.base.json Outdated
Comment thread libs/providers/localstorage/src/lib/localstorage-provider.spec.ts Outdated
Comment thread libs/providers/localstorage/src/lib/localstorage-provider.ts Outdated
@MattIPv4 MattIPv4 force-pushed the MattIPv4/localstorage-provider branch 2 times, most recently from 740e9ef to 2cc5877 Compare April 17, 2026 18:39
@MattIPv4 MattIPv4 marked this pull request as ready for review April 17, 2026 18:59
@MattIPv4 MattIPv4 requested review from a team as code owners April 17, 2026 18:59
Signed-off-by: MattIPv4 <me@mattcowley.co.uk>
Signed-off-by: MattIPv4 <me@mattcowley.co.uk>
Signed-off-by: MattIPv4 <me@mattcowley.co.uk>
@MattIPv4 MattIPv4 force-pushed the MattIPv4/localstorage-provider branch from 2cc5877 to ca9546a Compare April 17, 2026 19:14
Signed-off-by: MattIPv4 <me@mattcowley.co.uk>
Signed-off-by: MattIPv4 <me@mattcowley.co.uk>
@MattIPv4 MattIPv4 force-pushed the MattIPv4/localstorage-provider branch from ca9546a to 13c2085 Compare April 17, 2026 19:16
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.

3 participants