Skip to content

feat(browser-sdk/react-sdk/vue-sdk): end user opt in sdk - #689

Merged
roncohen merged 7 commits into
mainfrom
feat/end-user-opt-in-sdk
Aug 4, 2026
Merged

roncohen merged 7 commits into
mainfrom
feat/end-user-opt-in-sdk

Conversation

@roncohen

@roncohen roncohen commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Add end-user opt-in helpers for listing opt-in-enabled flags and setting whether the current user or company has opted into a flag.

@roncohen
roncohen marked this pull request as ready for review August 3, 2026 12:24

Copilot AI 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.

Pull request overview

This PR introduces end-user opt-in support across the Browser SDK, plus React/Vue convenience hooks/composables and documentation so applications can list opt-in-enabled flags and toggle opt-in membership for the current user or company.

Changes:

  • Add Browser SDK APIs/types for opt-in (getOptInFlags, setOptIn, OptInFlag, SetOptInOptions) and persist/parse opt-in metadata from evaluated flags.
  • Add React hooks (useOptInFlags, useSetOptIn) and Vue composables (useOptInFlags, useSetOptIn) with corresponding usage tests.
  • Improve Browser SDK flag refresh concurrency handling/rate limiting and add regression tests for out-of-order refreshes/context changes.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/vue-sdk/test/usage.test.ts Adds Vue tests covering opt-in composables behavior and delegation.
packages/vue-sdk/src/index.ts Re-exports new opt-in composables and opt-in related types.
packages/vue-sdk/src/hooks.ts Implements useOptInFlags and useSetOptIn composables.
packages/vue-sdk/README.md Documents Vue opt-in composables with an example UI pattern.
packages/react-sdk/test/usage.test.tsx Adds React hook tests for opt-in listing/updates and setOptIn delegation.
packages/react-sdk/src/index.tsx Implements and exports React opt-in hooks and re-exports opt-in types.
packages/react-sdk/README.md Documents React opt-in hooks with example usage and semantics.
packages/browser-sdk/test/flags.test.ts Adds tests for opt-in parsing and refresh concurrency/rate limiting; imports validateFlagsResponse.
packages/browser-sdk/test/deferred.ts Introduces a small deferred helper used by concurrency tests.
packages/browser-sdk/test/client.test.ts Adds end-to-end tests for opt-in flows and related state/concurrency behavior.
packages/browser-sdk/src/index.ts Exports new opt-in-related types from the Browser SDK entrypoint.
packages/browser-sdk/src/flag/flags.ts Adds opt-in flag types and improves refresh behavior for concurrent/out-of-order responses.
packages/browser-sdk/src/flag/flagCache.ts Extends API flag parsing to include opt-in metadata from responses/cached values.
packages/browser-sdk/src/client.ts Implements getOptInFlags and setOptIn, plus context-loading finalization for superseded updates.
packages/browser-sdk/README.md Documents Browser SDK opt-in API usage and expected semantics.
.changeset/end-user-opt-in-sdk.md Publishes minor versions for browser/react/vue SDKs for this feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/browser-sdk/src/flag/flagCache.ts
@roncohen
roncohen added this pull request to the merge queue Aug 4, 2026
Merged via the queue into main with commit 7f51b4a Aug 4, 2026
7 checks passed
@roncohen
roncohen deleted the feat/end-user-opt-in-sdk branch August 4, 2026 08:58
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