From af363377317b813fd94f3022be4bae2947ee72c3 Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:07:55 +0000 Subject: [PATCH 01/21] docs: remove prerelease wording from framework SDK READMEs --- packages/browser-sdk/README.md | 2 -- packages/react-native-sdk/README.md | 4 ++-- packages/react-sdk/README.md | 4 ++-- packages/vue-sdk/README.md | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/browser-sdk/README.md b/packages/browser-sdk/README.md index 10c44a2a..ef83fca6 100644 --- a/packages/browser-sdk/README.md +++ b/packages/browser-sdk/README.md @@ -2,8 +2,6 @@ Client-side feature flags and JSON values for [Reflag](https://reflag.com). -> This is a breaking v2 prerelease. It requires the v2 evaluated-flags/check protocol on the server. Do not switch existing v1 applications or bootstrap consumers without coordinating that upgrade. Nothing in this branch publishes or deploys the SDK/server. - ## Get started ```ts diff --git a/packages/react-native-sdk/README.md b/packages/react-native-sdk/README.md index 35429a2d..8eb914bb 100644 --- a/packages/react-native-sdk/README.md +++ b/packages/react-native-sdk/README.md @@ -2,12 +2,12 @@ React Native providers and hooks for Boolean and multivariate flags. Built on the matching React v2 SDK, with AsyncStorage persistence and a native SSE transport included. -This branch targets the v2 toolchain; it does not publish packages. Upgrade Node/bootstrap producers and Native consumers together. The [React SDK README](../react-sdk/README.md) covers the shared API. +Upgrade Node/bootstrap producers and Native consumers together. The [React SDK README](../react-sdk/README.md) covers the shared API. ## Install and initialize ```sh -npm install @reflag/react-native-sdk@2 +npm install @reflag/react-native-sdk ``` Requires React 17 or later (the modern JSX runtime) and a React version supported by your React Native app. Wrap your app with the Native provider, which supplies the platform adapters: diff --git a/packages/react-sdk/README.md b/packages/react-sdk/README.md index a451cb99..c3937262 100644 --- a/packages/react-sdk/README.md +++ b/packages/react-sdk/README.md @@ -2,7 +2,7 @@ Direct-value feature flags for React, backed by [Browser SDK v2](../browser-sdk/README.md). -> Breaking prerelease: requires compatible v2 server endpoints and **Node SDK v2** for bootstrap. The v2 CLI generates direct-value declarations; regenerate legacy wrapper-shaped output when migrating. Useful default-based inference does not require generated declarations. React Native remains on published React/Browser v1 in this repository. +> Bootstrap requires **Node SDK v2**. The v2 CLI generates direct-value declarations; regenerate legacy wrapper-shaped output when migrating. Useful default-based inference does not require generated declarations. ## Setup @@ -153,4 +153,4 @@ Metadata arrives with the initial v2 evaluation for regular providers. Bootstrap ## Migration from v1 -Use `const enabled = useFlag(key)` instead of destructuring `.isEnabled`. Replace wrapper config access with an authored multivariate flag and positional default. Move `.track()` and `.requestFeedback()` to separate hooks. Replace `useFlag(key, { suspense: true })` with `useFlagSuspense(key)`, and use `useIsLoading()` instead of a flag wrapper's loading property. Upgrade Browser/server bootstrap together. Nothing here publishes the prerelease or deploys its required server changes. +Use `const enabled = useFlag(key)` instead of destructuring `.isEnabled`. Replace wrapper config access with an authored multivariate flag and positional default. Move `.track()` and `.requestFeedback()` to separate hooks. Replace `useFlag(key, { suspense: true })` with `useFlagSuspense(key)`, and use `useIsLoading()` instead of a flag wrapper's loading property. Upgrade Browser/server bootstrap together. diff --git a/packages/vue-sdk/README.md b/packages/vue-sdk/README.md index 2dee709e..b5c74d74 100644 --- a/packages/vue-sdk/README.md +++ b/packages/vue-sdk/README.md @@ -2,7 +2,7 @@ Reactive direct-value flags for Vue 3, backed by [Browser SDK v2](../browser-sdk/README.md). -> Breaking prerelease: requires the compatible v2 server protocol. Bootstrap must come from **Node SDK v2**, not v1. Generated declarations are optional; the v2 CLI supports `--format vue` and direct-value schemas. Regenerate legacy wrapper-shaped declarations when migrating. +> Bootstrap must come from **Node SDK v2**, not v1. Generated declarations are optional; the v2 CLI supports `--format vue` and direct-value schemas. Regenerate legacy wrapper-shaped declarations when migrating. ## Setup @@ -128,4 +128,4 @@ declare module "@reflag/vue-sdk" { Registration constrains keys and checks non-null defaults against the registered value schema, including required and nested properties. Named-interface and readonly defaults are supported. Explicit `null` remains an arbitrary-JSON request; bare/`undefined` reads remain Boolean refs. Positional defaults still determine widened direct-value types, and generated declarations do not add nested runtime validation. The v2 CLI generates these schemas from current production-environment variants with `--format vue`; regenerate old wrapper declarations when migrating. -Replace `const { isEnabled } = useFlag(key)` with `const enabled = useFlag(key)` (then `enabled.value` in script). Replace remote-config wrappers with separately authored multivariate flags and positional defaults, and move usage/feedback into their separate composables. Bootstrap both ends with v2. This branch does not publish SDKs or deploy the required server changes. +Replace `const { isEnabled } = useFlag(key)` with `const enabled = useFlag(key)` (then `enabled.value` in script). Replace remote-config wrappers with separately authored multivariate flags and positional defaults, and move usage/feedback into their separate composables. Bootstrap both ends with v2. From 6221dd143c6ff2e99e9d2952ff86f9a246055265 Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:09:00 +0000 Subject: [PATCH 02/21] docs: simplify Browser SDK tagline --- packages/browser-sdk/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/browser-sdk/README.md b/packages/browser-sdk/README.md index ef83fca6..8402226c 100644 --- a/packages/browser-sdk/README.md +++ b/packages/browser-sdk/README.md @@ -1,6 +1,6 @@ # Reflag Browser SDK v2 -Client-side feature flags and JSON values for [Reflag](https://reflag.com). +Client-side feature flags for [Reflag](https://reflag.com). ## Get started From e520ca98d8d6ed4ba64134ad977919ee230f9740 Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:10:24 +0000 Subject: [PATCH 03/21] docs: always say React Native in the React Native README --- packages/react-native-sdk/README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/react-native-sdk/README.md b/packages/react-native-sdk/README.md index 8eb914bb..35797794 100644 --- a/packages/react-native-sdk/README.md +++ b/packages/react-native-sdk/README.md @@ -2,7 +2,7 @@ React Native providers and hooks for Boolean and multivariate flags. Built on the matching React v2 SDK, with AsyncStorage persistence and a native SSE transport included. -Upgrade Node/bootstrap producers and Native consumers together. The [React SDK README](../react-sdk/README.md) covers the shared API. +Upgrade Node/bootstrap producers and React Native consumers together. The [React SDK README](../react-sdk/README.md) covers the shared API. ## Install and initialize @@ -10,7 +10,7 @@ Upgrade Node/bootstrap producers and Native consumers together. The [React SDK R npm install @reflag/react-native-sdk ``` -Requires React 17 or later (the modern JSX runtime) and a React version supported by your React Native app. Wrap your app with the Native provider, which supplies the platform adapters: +Requires React 17 or later (the modern JSX runtime) and a React version supported by your React Native app. Wrap your app with the React Native provider, which supplies the platform adapters: ```tsx import { ReflagProvider } from "@reflag/react-native-sdk"; @@ -26,7 +26,7 @@ import { ReflagProvider } from "@reflag/react-native-sdk"; ; ``` -Use only publishable keys in the app, never server secret keys. Native providers default live updates on, persistence to AsyncStorage, and SSE to `react-native-sse` with transport polling disabled. `storage`, `eventSourceFactory`, and `enableLiveFlagUpdates` remain configurable. +Use only publishable keys in the app, never server secret keys. React Native providers default live updates on, persistence to AsyncStorage, and SSE to `react-native-sse` with transport polling disabled. `storage`, `eventSourceFactory`, and `enableLiveFlagUpdates` remain configurable. ## Read flags and track usage @@ -86,7 +86,7 @@ const flags = serverClient.getFlagsForBootstrap({ }); ``` -Pass the complete serialized envelope to Native: +Pass the complete serialized envelope to React Native: ```tsx import { ReflagBootstrappedProvider } from "@reflag/react-native-sdk"; @@ -101,19 +101,19 @@ import { ReflagBootstrappedProvider } from "@reflag/react-native-sdk"; The envelope contains `protocolVersion: 2`, context, evaluated flags and an optional snapshot version. Legacy v1 bootstrap is rejected. Live updates require a snapshot version. Never expose secret keys or server-only attributes in bootstrap data: later refreshes use app-visible context and may differ from server evaluation. Disable live updates when later client evaluation must not replace the server result. Requesting missing opt-in metadata still makes a client-side request even with live updates disabled. -`ReflagClientProvider` accepts an externally initialized matching v2 client. Its lifecycle and platform-adapter configuration belong to your application; the Native convenience providers do not configure an external client. +`ReflagClientProvider` accepts an externally initialized matching v2 client. Its lifecycle and platform-adapter configuration belong to your application; the React Native convenience providers do not configure an external client. ## Opt-in and feedback `useOptInFlags()` returns metadata and loading state; `useSetOptIn()` changes membership. Metadata arrives with ordinary `/flags/evaluated` responses, or on demand after bootstrap without replacing server-derived values. User/company grants stay independent. Successful mutations confirm versioned evaluation and membership in one refresh. Check the returned `Response.ok` and catch rejections: confirmation can fail after membership changed remotely, and skipped calls return undefined. Failed metadata loading settles without exposing an error; use `useClient().refresh()` to retry. -The toolbar and built-in feedback UI are web-only and disabled by default. Use your own Native feedback UI with `useSendFeedback()` or `client.feedback()`; enabling a web UI option does not make it Native-compatible. +The toolbar and built-in feedback UI are web-only and disabled by default. Use your own React Native feedback UI with `useSendFeedback()` or `client.feedback()`; enabling a web UI option does not make it React Native-compatible. `enableTracking: false` disables checks and ordinary tracking. Offline mode skips HTTP/tracking; use direct-value fallbacks such as `fallbackFlags={{ huddle: true, settings: { mode: "offline" } }}`. ## Optional key registration -Native reexports React's hooks and **shares React's `Flags` registry**. Register direct-value schemas in `@reflag/react-sdk`, not a separate Native registry: +React Native reexports React's hooks and **shares React's `Flags` registry**. Register direct-value schemas in `@reflag/react-sdk`, not a separate React Native registry: ```ts import "@reflag/react-native-sdk"; @@ -126,7 +126,7 @@ declare module "@reflag/react-sdk" { } ``` -Registration constrains keys and checks non-null positional defaults, including required and nested fields. Named-interface and readonly defaults work. It does not restore wrappers or validate nested runtime payloads. The Native package reexports the same registry/types; v2 CLI React-format declarations target this shared interface. Regenerate legacy wrapper declarations before use; CLI v2 is a separate release dependency. +Registration constrains keys and checks non-null positional defaults, including required and nested fields. Named-interface and readonly defaults work. It does not restore wrappers or validate nested runtime payloads. The React Native package reexports the same registry/types; v2 CLI React-format declarations target this shared interface. Regenerate legacy wrapper declarations before use; CLI v2 is a separate release dependency. ## Refresh when returning to the foreground @@ -154,7 +154,7 @@ function AppStateListener() { } ``` -Mount this listener under a Native provider. Context prop changes and `useUpdateUser`/`useUpdateCompany`/`useUpdateOtherContext` also update evaluation context. +Mount this listener under a React Native provider. Context prop changes and `useUpdateUser`/`useUpdateCompany`/`useUpdateOtherContext` also update evaluation context. ## Migrating from v1 @@ -162,6 +162,6 @@ Mount this listener under a Native provider. Context prop changes and `useUpdate - Replace remote-config wrappers with authored multivariate flags and positional JSON defaults. - Use `useFlagSuspense`, not `useFlag(key, { suspense: true })`, for readiness-waiting reads. - Use direct-value fallback maps for multivariate flags; Boolean string-array shorthand remains supported. Migrate both ends of bootstrap to protocol v2. -- Rebuild against matching Native/React/Browser v2 packages and regenerate legacy declarations. +- Rebuild against matching React Native/React/Browser v2 packages and regenerate legacy declarations. -The [Expo](https://github.com/reflagcom/javascript/tree/main/packages/react-native-sdk/dev/expo) and [bare React Native](https://github.com/reflagcom/javascript/tree/main/packages/react-native-sdk/dev/bare-rn) examples use the v2 Native APIs. OpenFeature providers are separate integrations and do not gain v2 support from this migration. +The [Expo](https://github.com/reflagcom/javascript/tree/main/packages/react-native-sdk/dev/expo) and [bare React Native](https://github.com/reflagcom/javascript/tree/main/packages/react-native-sdk/dev/bare-rn) examples use the v2 React Native APIs. OpenFeature providers are separate integrations and do not gain v2 support from this migration. From d20c2c9135416990d28951982dd46753460a301a Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:10:32 +0000 Subject: [PATCH 04/21] docs: name the React Native SDK and provider explicitly --- packages/react-native-sdk/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native-sdk/README.md b/packages/react-native-sdk/README.md index 35797794..d8d77a9f 100644 --- a/packages/react-native-sdk/README.md +++ b/packages/react-native-sdk/README.md @@ -86,7 +86,7 @@ const flags = serverClient.getFlagsForBootstrap({ }); ``` -Pass the complete serialized envelope to React Native: +Pass the complete serialized envelope to the React Native provider: ```tsx import { ReflagBootstrappedProvider } from "@reflag/react-native-sdk"; @@ -113,7 +113,7 @@ The toolbar and built-in feedback UI are web-only and disabled by default. Use y ## Optional key registration -React Native reexports React's hooks and **shares React's `Flags` registry**. Register direct-value schemas in `@reflag/react-sdk`, not a separate React Native registry: +The React Native SDK reexports React's hooks and **shares React's `Flags` registry**. Register direct-value schemas in `@reflag/react-sdk`, not a separate React Native registry: ```ts import "@reflag/react-native-sdk"; From 8ab879817a27e2d741619f7fa166abf2e0b387bb Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:11:04 +0000 Subject: [PATCH 05/21] docs: move the bootstrap upgrade note into React Native migration --- packages/react-native-sdk/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native-sdk/README.md b/packages/react-native-sdk/README.md index d8d77a9f..0320a5fe 100644 --- a/packages/react-native-sdk/README.md +++ b/packages/react-native-sdk/README.md @@ -2,7 +2,7 @@ React Native providers and hooks for Boolean and multivariate flags. Built on the matching React v2 SDK, with AsyncStorage persistence and a native SSE transport included. -Upgrade Node/bootstrap producers and React Native consumers together. The [React SDK README](../react-sdk/README.md) covers the shared API. +The [React SDK README](../react-sdk/README.md) covers the shared API. ## Install and initialize @@ -161,7 +161,7 @@ Mount this listener under a React Native provider. Context prop changes and `use - Replace `const { isEnabled, track } = useFlag(key)` with `const enabled = useFlag(key)` and a separate `useTrack()` call. - Replace remote-config wrappers with authored multivariate flags and positional JSON defaults. - Use `useFlagSuspense`, not `useFlag(key, { suspense: true })`, for readiness-waiting reads. -- Use direct-value fallback maps for multivariate flags; Boolean string-array shorthand remains supported. Migrate both ends of bootstrap to protocol v2. +- Use direct-value fallback maps for multivariate flags; Boolean string-array shorthand remains supported. If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data at the same time as the app. - Rebuild against matching React Native/React/Browser v2 packages and regenerate legacy declarations. The [Expo](https://github.com/reflagcom/javascript/tree/main/packages/react-native-sdk/dev/expo) and [bare React Native](https://github.com/reflagcom/javascript/tree/main/packages/react-native-sdk/dev/bare-rn) examples use the v2 React Native APIs. OpenFeature providers are separate integrations and do not gain v2 support from this migration. From a182c3d048a99eb173a6faa61b872972c54576f8 Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:12:01 +0000 Subject: [PATCH 06/21] docs: move React and Vue bootstrap upgrade notes into migration --- packages/react-sdk/README.md | 4 +--- packages/vue-sdk/README.md | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/react-sdk/README.md b/packages/react-sdk/README.md index c3937262..02cf7ec5 100644 --- a/packages/react-sdk/README.md +++ b/packages/react-sdk/README.md @@ -2,8 +2,6 @@ Direct-value feature flags for React, backed by [Browser SDK v2](../browser-sdk/README.md). -> Bootstrap requires **Node SDK v2**. The v2 CLI generates direct-value declarations; regenerate legacy wrapper-shaped output when migrating. Useful default-based inference does not require generated declarations. - ## Setup ```tsx @@ -153,4 +151,4 @@ Metadata arrives with the initial v2 evaluation for regular providers. Bootstrap ## Migration from v1 -Use `const enabled = useFlag(key)` instead of destructuring `.isEnabled`. Replace wrapper config access with an authored multivariate flag and positional default. Move `.track()` and `.requestFeedback()` to separate hooks. Replace `useFlag(key, { suspense: true })` with `useFlagSuspense(key)`, and use `useIsLoading()` instead of a flag wrapper's loading property. Upgrade Browser/server bootstrap together. +Use `const enabled = useFlag(key)` instead of destructuring `.isEnabled`. Replace wrapper config access with an authored multivariate flag and positional default. Move `.track()` and `.requestFeedback()` to separate hooks. Replace `useFlag(key, { suspense: true })` with `useFlagSuspense(key)`, and use `useIsLoading()` instead of a flag wrapper's loading property. If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data to v2 at the same time. diff --git a/packages/vue-sdk/README.md b/packages/vue-sdk/README.md index b5c74d74..0eb008ad 100644 --- a/packages/vue-sdk/README.md +++ b/packages/vue-sdk/README.md @@ -2,8 +2,6 @@ Reactive direct-value flags for Vue 3, backed by [Browser SDK v2](../browser-sdk/README.md). -> Bootstrap must come from **Node SDK v2**, not v1. Generated declarations are optional; the v2 CLI supports `--format vue` and direct-value schemas. Regenerate legacy wrapper-shaped declarations when migrating. - ## Setup ```vue @@ -128,4 +126,4 @@ declare module "@reflag/vue-sdk" { Registration constrains keys and checks non-null defaults against the registered value schema, including required and nested properties. Named-interface and readonly defaults are supported. Explicit `null` remains an arbitrary-JSON request; bare/`undefined` reads remain Boolean refs. Positional defaults still determine widened direct-value types, and generated declarations do not add nested runtime validation. The v2 CLI generates these schemas from current production-environment variants with `--format vue`; regenerate old wrapper declarations when migrating. -Replace `const { isEnabled } = useFlag(key)` with `const enabled = useFlag(key)` (then `enabled.value` in script). Replace remote-config wrappers with separately authored multivariate flags and positional defaults, and move usage/feedback into their separate composables. Bootstrap both ends with v2. +Replace `const { isEnabled } = useFlag(key)` with `const enabled = useFlag(key)` (then `enabled.value` in script). Replace remote-config wrappers with separately authored multivariate flags and positional defaults, and move usage/feedback into their separate composables. If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data to v2 at the same time. From 5d5f8588fde67d7725a9ee4c4aea4d35aac447a3 Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:13:26 +0000 Subject: [PATCH 07/21] docs: drop bootstrap secrets warning from framework READMEs --- packages/browser-sdk/README.md | 2 +- packages/react-native-sdk/README.md | 2 +- packages/react-sdk/README.md | 2 +- packages/vue-sdk/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/browser-sdk/README.md b/packages/browser-sdk/README.md index 8402226c..5a368e95 100644 --- a/packages/browser-sdk/README.md +++ b/packages/browser-sdk/README.md @@ -115,7 +115,7 @@ await reflag.initialize(); const enabled = reflag.getFlag("release"); ``` -The payload includes `protocolVersion: 2`, context, evaluated diagnostics/selections and an optional snapshot version. V1 payloads and the old `bootstrappedFlags` option are rejected. Preserve the entire envelope; do not pass just its `flags` property. A version is required for bootstrapped live updates. Never embed secrets or server-only context in public bootstrap data. Later refreshes use browser-visible context and can differ from server-only evaluation; disable live updates when that is inappropriate. Requesting missing opt-in metadata still makes a browser-side request even when live updates are disabled. +The payload includes `protocolVersion: 2`, context, evaluated diagnostics/selections and an optional snapshot version. V1 payloads and the old `bootstrappedFlags` option are rejected. Preserve the entire envelope; do not pass just its `flags` property. A version is required for bootstrapped live updates. Later refreshes use browser-visible context and can differ from server-only evaluation; disable live updates when that is inappropriate. Requesting missing opt-in metadata still makes a browser-side request even when live updates are disabled. ## End-user opt-in diff --git a/packages/react-native-sdk/README.md b/packages/react-native-sdk/README.md index 0320a5fe..a37c6a8e 100644 --- a/packages/react-native-sdk/README.md +++ b/packages/react-native-sdk/README.md @@ -99,7 +99,7 @@ import { ReflagBootstrappedProvider } from "@reflag/react-native-sdk"; ; ``` -The envelope contains `protocolVersion: 2`, context, evaluated flags and an optional snapshot version. Legacy v1 bootstrap is rejected. Live updates require a snapshot version. Never expose secret keys or server-only attributes in bootstrap data: later refreshes use app-visible context and may differ from server evaluation. Disable live updates when later client evaluation must not replace the server result. Requesting missing opt-in metadata still makes a client-side request even with live updates disabled. +The envelope contains `protocolVersion: 2`, context, evaluated flags and an optional snapshot version. Legacy v1 bootstrap is rejected. Live updates require a snapshot version. Later refreshes use app-visible context and may differ from server evaluation. Disable live updates when later client evaluation must not replace the server result. Requesting missing opt-in metadata still makes a client-side request even with live updates disabled. `ReflagClientProvider` accepts an externally initialized matching v2 client. Its lifecycle and platform-adapter configuration belong to your application; the React Native convenience providers do not configure an external client. diff --git a/packages/react-sdk/README.md b/packages/react-sdk/README.md index 02cf7ec5..ce1b8f2d 100644 --- a/packages/react-sdk/README.md +++ b/packages/react-sdk/README.md @@ -120,7 +120,7 @@ import { ReflagBootstrappedProvider } from "@reflag/react-sdk"; ; ``` -The envelope includes `protocolVersion: 2`, context, evaluated flag results and optional `flagStateVersion`. V1 bootstrap is rejected. Use a snapshot version for live updates; later refreshes use browser-visible context. Do not send secrets/server-only attributes to the browser. Disable live updates if later browser evaluation must not replace server-only results. Requesting missing opt-in metadata still makes a browser-side request even when live updates are disabled. +The envelope includes `protocolVersion: 2`, context, evaluated flag results and optional `flagStateVersion`. V1 bootstrap is rejected. Use a snapshot version for live updates; later refreshes use browser-visible context. Disable live updates if later browser evaluation must not replace server-only results. Requesting missing opt-in metadata still makes a browser-side request even when live updates are disabled. For a pre-existing Browser v2 client, use ``. The provider does not own its lifecycle; initialize/stop externally, except that a suspending read can start on-demand initialization. diff --git a/packages/vue-sdk/README.md b/packages/vue-sdk/README.md index 0eb008ad..527e74e8 100644 --- a/packages/vue-sdk/README.md +++ b/packages/vue-sdk/README.md @@ -84,7 +84,7 @@ const flags = serverClient.getFlagsForBootstrap(context); ``` -Pass the entire envelope (`protocolVersion: 2`, context, evaluated flags and optional snapshot version). Legacy v1 bootstrap is rejected. A snapshot version is required for live updates. Never expose secret keys/server-only attributes in bootstrap data; later refreshes use browser-visible context, so disable live updates when they must not replace server-only evaluations. Requesting missing opt-in metadata still makes a browser-side request even when live updates are disabled. +Pass the entire envelope (`protocolVersion: 2`, context, evaluated flags and optional snapshot version). Legacy v1 bootstrap is rejected. A snapshot version is required for live updates. Later refreshes use browser-visible context, so disable live updates when they must not replace server-only evaluations. Requesting missing opt-in metadata still makes a browser-side request even when live updates are disabled. `ReflagClientProvider` accepts an externally initialized Browser v2 client. Its lifecycle belongs to the application. From 30bbdb5f650c7ba8973b84a654ae7bed55c66e1a Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:14:57 +0000 Subject: [PATCH 08/21] docs: simplify React Native key registration --- packages/react-native-sdk/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-sdk/README.md b/packages/react-native-sdk/README.md index a37c6a8e..79115873 100644 --- a/packages/react-native-sdk/README.md +++ b/packages/react-native-sdk/README.md @@ -126,7 +126,7 @@ declare module "@reflag/react-sdk" { } ``` -Registration constrains keys and checks non-null positional defaults, including required and nested fields. Named-interface and readonly defaults work. It does not restore wrappers or validate nested runtime payloads. The React Native package reexports the same registry/types; v2 CLI React-format declarations target this shared interface. Regenerate legacy wrapper declarations before use; CLI v2 is a separate release dependency. +Registered flags get autocompletion for their keys and type checks for the defaults you pass. The checks happen at compile time only. To generate the declarations, run `npx reflag flags types` with the `react` format. ## Refresh when returning to the foreground From 2051abaf4033f85b5c27915432a0cfcff0c137f8 Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:16:33 +0000 Subject: [PATCH 09/21] docs: explain React Native fallback flag migration plainly --- packages/react-native-sdk/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-native-sdk/README.md b/packages/react-native-sdk/README.md index 79115873..615aa44b 100644 --- a/packages/react-native-sdk/README.md +++ b/packages/react-native-sdk/README.md @@ -161,7 +161,8 @@ Mount this listener under a React Native provider. Context prop changes and `use - Replace `const { isEnabled, track } = useFlag(key)` with `const enabled = useFlag(key)` and a separate `useTrack()` call. - Replace remote-config wrappers with authored multivariate flags and positional JSON defaults. - Use `useFlagSuspense`, not `useFlag(key, { suspense: true })`, for readiness-waiting reads. -- Use direct-value fallback maps for multivariate flags; Boolean string-array shorthand remains supported. If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data at the same time as the app. +- In `fallbackFlags`, give each flag its value, such as `{ huddles: true, model: "quick" }`, instead of v1's `{ key, payload }` objects. A list of flag keys still works for Boolean flags. +- If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data at the same time as the app. - Rebuild against matching React Native/React/Browser v2 packages and regenerate legacy declarations. The [Expo](https://github.com/reflagcom/javascript/tree/main/packages/react-native-sdk/dev/expo) and [bare React Native](https://github.com/reflagcom/javascript/tree/main/packages/react-native-sdk/dev/bare-rn) examples use the v2 React Native APIs. OpenFeature providers are separate integrations and do not gain v2 support from this migration. From edd76ca44e2c7a528dbe81c4e1db41efc1fe58be Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:18:40 +0000 Subject: [PATCH 10/21] docs: replace direct-value terminology in framework READMEs --- packages/browser-sdk/README.md | 4 ++-- packages/react-native-sdk/README.md | 8 ++++---- packages/react-sdk/README.md | 6 +++--- packages/vue-sdk/README.md | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/browser-sdk/README.md b/packages/browser-sdk/README.md index 5a368e95..544d15c9 100644 --- a/packages/browser-sdk/README.md +++ b/packages/browser-sdk/README.md @@ -26,7 +26,7 @@ if (enabled) { Use only a **publishable** key in a browser. Secret keys belong on your server. -## Direct-value reads +## Read flags ```ts reflag.getFlag("release"); // boolean; missing/mismatched -> false @@ -43,7 +43,7 @@ reflag.getFlag("nullable-settings", null); // FlagValue (arbitrary JSON) - Object fields and array elements are **not schema-validated**. Validate untrusted/nested payloads in your application. - Values and defaults are returned as independent mutable copies. There are no reserved JSON property names. -`getFlags()` returns a direct-value record (entries may be undefined) and registers checks for its returned roots. `getFlagResults()` returns owned evaluated diagnostics **without checks**; it is intended for tooling, not ordinary application reads. `getFlagsForBootstrap()` serializes protocol-v2 evaluated state without checks. +`getFlags()` returns a record of flag values (entries may be undefined) and registers checks for its returned roots. `getFlagResults()` returns owned evaluated diagnostics **without checks**; it is intended for tooling, not ordinary application reads. `getFlagsForBootstrap()` serializes protocol-v2 evaluated state without checks. ## Checks and delivery diff --git a/packages/react-native-sdk/README.md b/packages/react-native-sdk/README.md index 615aa44b..74057abc 100644 --- a/packages/react-native-sdk/README.md +++ b/packages/react-native-sdk/README.md @@ -50,9 +50,9 @@ function StartHuddleButton() { } ``` -Defaults infer widened direct-value types without generated declarations. Accepted false, zero, empty strings and null are not replaced by truthy fallbacks. Explicit `null` requests arbitrary JSON; `undefined` retains the Boolean-first behavior. Returned JSON values are independent copies. Defaults check top-level categories, not nested runtime schemas. +A default sets the return type, even without generated declarations. Accepted false, zero, empty strings and null are not replaced by truthy fallbacks. Explicit `null` requests arbitrary JSON; `undefined` retains the Boolean-first behavior. Returned JSON values are independent copies. Defaults check top-level categories, not nested runtime schemas. -Reading registers root checks immediately; application usage remains separate through `useTrack()`. `useClient().getFlags()` also returns direct values, not v1 flag wrappers. `useIsLoading()` reports readiness separately. +Reading registers root checks immediately; application usage remains separate through `useTrack()`. `useClient().getFlags()` returns all flag values. `useIsLoading()` reports readiness separately. ## Suspense @@ -109,11 +109,11 @@ The envelope contains `protocolVersion: 2`, context, evaluated flags and an opti The toolbar and built-in feedback UI are web-only and disabled by default. Use your own React Native feedback UI with `useSendFeedback()` or `client.feedback()`; enabling a web UI option does not make it React Native-compatible. -`enableTracking: false` disables checks and ordinary tracking. Offline mode skips HTTP/tracking; use direct-value fallbacks such as `fallbackFlags={{ huddle: true, settings: { mode: "offline" } }}`. +`enableTracking: false` disables checks and ordinary tracking. Offline mode skips HTTP/tracking; set fallback values such as `fallbackFlags={{ huddle: true, settings: { mode: "offline" } }}`. ## Optional key registration -The React Native SDK reexports React's hooks and **shares React's `Flags` registry**. Register direct-value schemas in `@reflag/react-sdk`, not a separate React Native registry: +The React Native SDK reexports React's hooks and **shares React's `Flags` registry**. Register flag types in `@reflag/react-sdk`, not a separate React Native registry: ```ts import "@reflag/react-native-sdk"; diff --git a/packages/react-sdk/README.md b/packages/react-sdk/README.md index ce1b8f2d..5338263f 100644 --- a/packages/react-sdk/README.md +++ b/packages/react-sdk/README.md @@ -1,6 +1,6 @@ # Reflag React SDK v2 -Direct-value feature flags for React, backed by [Browser SDK v2](../browser-sdk/README.md). +Feature flags for React, built on the [Browser SDK](../browser-sdk/README.md). ## Setup @@ -38,7 +38,7 @@ function Huddles() { } ``` -Bare reads return Boolean/false, including while initial data is unavailable. A positional default infers widened direct types, even without generated declarations: +Bare reads return Boolean/false, including while initial data is unavailable. A default sets the return type, even without generated declarations: ```ts useFlag("model", "quick"); // string @@ -129,7 +129,7 @@ For a pre-existing Browser v2 client, use ` Date: Sat, 28 Nov 2026 18:19:06 +0000 Subject: [PATCH 11/21] docs: simplify React and Vue key registration --- packages/react-sdk/README.md | 4 ++-- packages/vue-sdk/README.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/react-sdk/README.md b/packages/react-sdk/README.md index 5338263f..4bd46803 100644 --- a/packages/react-sdk/README.md +++ b/packages/react-sdk/README.md @@ -100,7 +100,7 @@ declare module "@reflag/react-sdk" { } ``` -Registration constrains keys and checks non-null defaults against the registered value schema, including required and nested properties. Named-interface and readonly defaults are supported. Explicit `null` remains an arbitrary-JSON request; bare/`undefined` reads remain Boolean. The positional default still determines the widened return type, and generated declarations do not add nested runtime validation. The same rules apply to `useFlagSuspense`. The v2 CLI generates direct-value declarations from current production-environment variants; regenerate legacy wrapper declarations when migrating. +Registered flags get autocompletion for their keys and type checks for the defaults you pass, in both `useFlag()` and `useFlagSuspense()`. The checks happen at compile time only. To generate the declarations, run `npx reflag flags types` with the `react` format. ## Bootstrap and SSR @@ -151,4 +151,4 @@ Metadata arrives with the initial v2 evaluation for regular providers. Bootstrap ## Migration from v1 -Use `const enabled = useFlag(key)` instead of destructuring `.isEnabled`. Replace wrapper config access with an authored multivariate flag and positional default. Move `.track()` and `.requestFeedback()` to separate hooks. Replace `useFlag(key, { suspense: true })` with `useFlagSuspense(key)`, and use `useIsLoading()` instead of a flag wrapper's loading property. If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data to v2 at the same time. +Use `const enabled = useFlag(key)` instead of destructuring `.isEnabled`. Replace wrapper config access with an authored multivariate flag and positional default. Move `.track()` and `.requestFeedback()` to separate hooks. Replace `useFlag(key, { suspense: true })` with `useFlagSuspense(key)`, and use `useIsLoading()` instead of a flag wrapper's loading property. If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data to v2 at the same time. If you generate type declarations, regenerate them with the v2 CLI. diff --git a/packages/vue-sdk/README.md b/packages/vue-sdk/README.md index 0a3a9add..00e74c13 100644 --- a/packages/vue-sdk/README.md +++ b/packages/vue-sdk/README.md @@ -108,7 +108,7 @@ const sendFeedback = useSendFeedback(); await sendFeedback({ flagKey: "huddles", score: 5 }); ``` -Opt-in metadata arrives with ordinary `/flags/evaluated` responses. Bootstrapped providers fetch missing metadata on demand from the same v2 endpoint without replacing server-derived values or provenance; loading settles on success or failure. User/company grants remain independent; successful mutations confirm versioned evaluation and membership in a single refresh. The metadata list retains presentation/membership fields such as `isEnabled`; ordinary reads remain direct values. Check the returned `Response.ok` and catch rejections; a confirmation failure can occur after membership changed remotely, and skipped calls return undefined. Failed metadata requests settle loading without exposing an error; use `useClient().refresh()` to retry. +Opt-in metadata arrives with ordinary `/flags/evaluated` responses. Bootstrapped providers fetch missing metadata on demand from the same v2 endpoint without replacing server-derived values or provenance; loading settles on success or failure. User/company grants remain independent; successful mutations confirm versioned evaluation and membership in a single refresh. Check the returned `Response.ok` and catch rejections; a confirmation failure can occur after membership changed remotely, and skipped calls return undefined. Failed metadata requests settle loading without exposing an error; use `useClient().refresh()` to retry. `enableTracking: false` disables checks and ordinary tracking. Offline mode skips HTTP/tracking. See [Browser feedback documentation](../browser-sdk/FEEDBACK.md) for prompting/UI options. @@ -124,6 +124,6 @@ declare module "@reflag/vue-sdk" { } ``` -Registration constrains keys and checks non-null defaults against the registered value schema, including required and nested properties. Named-interface and readonly defaults are supported. Explicit `null` remains an arbitrary-JSON request; bare/`undefined` reads remain Boolean refs. Positional defaults still determine widened direct-value types, and generated declarations do not add nested runtime validation. The v2 CLI generates these schemas from current production-environment variants with `--format vue`; regenerate old wrapper declarations when migrating. +Registered flags get autocompletion for their keys and type checks for the defaults you pass. The checks happen at compile time only. To generate the declarations, run `npx reflag flags types` with the `vue` format. -Replace `const { isEnabled } = useFlag(key)` with `const enabled = useFlag(key)` (then `enabled.value` in script). Replace remote-config wrappers with separately authored multivariate flags and positional defaults, and move usage/feedback into their separate composables. If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data to v2 at the same time. +Replace `const { isEnabled } = useFlag(key)` with `const enabled = useFlag(key)` (then `enabled.value` in script). Replace remote-config wrappers with separately authored multivariate flags and positional defaults, and move usage/feedback into their separate composables. If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data to v2 at the same time. If you generate type declarations, regenerate them with the v2 CLI. From c40de4fa2f9c29fe5ea645896279aed22720896d Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:33:00 +0000 Subject: [PATCH 12/21] docs: name fallbackFlags explicitly in React Native README --- packages/react-native-sdk/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-sdk/README.md b/packages/react-native-sdk/README.md index 74057abc..0a91c995 100644 --- a/packages/react-native-sdk/README.md +++ b/packages/react-native-sdk/README.md @@ -109,7 +109,7 @@ The envelope contains `protocolVersion: 2`, context, evaluated flags and an opti The toolbar and built-in feedback UI are web-only and disabled by default. Use your own React Native feedback UI with `useSendFeedback()` or `client.feedback()`; enabling a web UI option does not make it React Native-compatible. -`enableTracking: false` disables checks and ordinary tracking. Offline mode skips HTTP/tracking; set fallback values such as `fallbackFlags={{ huddle: true, settings: { mode: "offline" } }}`. +`enableTracking: false` disables checks and ordinary tracking. `fallbackFlags` sets the values flags return when the app has no flag data, either in offline mode or when the first fetch fails and nothing is cached: `fallbackFlags={{ huddle: true, settings: { mode: "offline" } }}`. Offline mode also skips all requests and tracking. ## Optional key registration From 43170de5776ed6677aa9f548455ea549eb72655e Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:47:42 +0000 Subject: [PATCH 13/21] docs: replace fallbackFlags with read defaults in framework READMEs --- packages/browser-sdk/README.md | 2 +- packages/react-native-sdk/README.md | 4 ++-- packages/react-sdk/README.md | 4 ++-- packages/vue-sdk/README.md | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/browser-sdk/README.md b/packages/browser-sdk/README.md index 544d15c9..6a8cf6ce 100644 --- a/packages/browser-sdk/README.md +++ b/packages/browser-sdk/README.md @@ -81,7 +81,6 @@ Constructor options include: | `staleWhileRevalidate` | Serve stale cached state while revalidating; default false | | `expireTimeMs` | Cache expiry; default 30 days | | `storage` | Optional async storage adapter | -| `fallbackFlags` | Value record or array of enabled Boolean keys, without authored provenance | | `enableLiveFlagUpdates` | Refresh after SSE publications; default false in Browser, true in React/Vue | | `eventSourceFactory` | Optional EventSource-compatible transport | | `trackingQueue` | Buffered-delivery `flushDelayMs` and `maxSize` | @@ -145,6 +144,7 @@ Use `track(eventName, attributes?)`, `feedback(payload)` and `requestFeedback({ - Replace `getFlag(key).isEnabled` with `getFlag(key)`. - Replace legacy remote config access with a separately authored multivariate flag and a positional default. Legacy config is **not** automatically converted into v2 values. - Move flag `.track()` / `.requestFeedback()` calls to ordinary client methods. +- Remove `fallbackFlags` and pass a default to each read instead, such as `getFlag("huddles", true)`. The default is returned whenever the flag has no value. - Replace wrapper overrides with `setFlagOverride(key, value)`; undefined clears, null is a value. - `getFlags()` now returns values and registers checks. Tooling should use `getFlagResults()`. - Upgrade both ends of bootstrap to v2. Old Browser/framework clients remain incompatible with v2 bootstrap. diff --git a/packages/react-native-sdk/README.md b/packages/react-native-sdk/README.md index 0a91c995..479cd2f9 100644 --- a/packages/react-native-sdk/README.md +++ b/packages/react-native-sdk/README.md @@ -109,7 +109,7 @@ The envelope contains `protocolVersion: 2`, context, evaluated flags and an opti The toolbar and built-in feedback UI are web-only and disabled by default. Use your own React Native feedback UI with `useSendFeedback()` or `client.feedback()`; enabling a web UI option does not make it React Native-compatible. -`enableTracking: false` disables checks and ordinary tracking. `fallbackFlags` sets the values flags return when the app has no flag data, either in offline mode or when the first fetch fails and nothing is cached: `fallbackFlags={{ huddle: true, settings: { mode: "offline" } }}`. Offline mode also skips all requests and tracking. +`enableTracking: false` disables checks and ordinary tracking. Offline mode skips all requests and tracking, and reads return their defaults. ## Optional key registration @@ -161,7 +161,7 @@ Mount this listener under a React Native provider. Context prop changes and `use - Replace `const { isEnabled, track } = useFlag(key)` with `const enabled = useFlag(key)` and a separate `useTrack()` call. - Replace remote-config wrappers with authored multivariate flags and positional JSON defaults. - Use `useFlagSuspense`, not `useFlag(key, { suspense: true })`, for readiness-waiting reads. -- In `fallbackFlags`, give each flag its value, such as `{ huddles: true, model: "quick" }`, instead of v1's `{ key, payload }` objects. A list of flag keys still works for Boolean flags. +- Remove `fallbackFlags` and pass a default to each read instead, such as `useFlag("huddles", true)`. The default is returned whenever the flag has no value. - If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data at the same time as the app. - Rebuild against matching React Native/React/Browser v2 packages and regenerate legacy declarations. diff --git a/packages/react-sdk/README.md b/packages/react-sdk/README.md index 4bd46803..899763b8 100644 --- a/packages/react-sdk/README.md +++ b/packages/react-sdk/README.md @@ -18,7 +18,7 @@ import { ReflagProvider } from "@reflag/react-sdk"; ; ``` -Provider options forward Browser SDK settings, including `logger`, `debug`, `enableTracking`, `offline`, cache/fallback options, `toolbar`, `feedback`, `credentials` and API origins. A custom logger takes precedence over debug logging. Live updates default to true; set `enableLiveFlagUpdates={false}` to disable them. +Provider options forward Browser SDK settings, including `logger`, `debug`, `enableTracking`, `offline`, cache options, `toolbar`, `feedback`, `credentials` and API origins. A custom logger takes precedence over debug logging. Live updates default to true; set `enableLiveFlagUpdates={false}` to disable them. ## `useFlag(key, defaultValue?)` @@ -151,4 +151,4 @@ Metadata arrives with the initial v2 evaluation for regular providers. Bootstrap ## Migration from v1 -Use `const enabled = useFlag(key)` instead of destructuring `.isEnabled`. Replace wrapper config access with an authored multivariate flag and positional default. Move `.track()` and `.requestFeedback()` to separate hooks. Replace `useFlag(key, { suspense: true })` with `useFlagSuspense(key)`, and use `useIsLoading()` instead of a flag wrapper's loading property. If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data to v2 at the same time. If you generate type declarations, regenerate them with the v2 CLI. +Use `const enabled = useFlag(key)` instead of destructuring `.isEnabled`. Replace wrapper config access with an authored multivariate flag and positional default. Move `.track()` and `.requestFeedback()` to separate hooks. Remove `fallbackFlags` and pass a default to each read instead, such as `useFlag("huddles", true)`. Replace `useFlag(key, { suspense: true })` with `useFlagSuspense(key)`, and use `useIsLoading()` instead of a flag wrapper's loading property. If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data to v2 at the same time. If you generate type declarations, regenerate them with the v2 CLI. diff --git a/packages/vue-sdk/README.md b/packages/vue-sdk/README.md index 00e74c13..2b51b3de 100644 --- a/packages/vue-sdk/README.md +++ b/packages/vue-sdk/README.md @@ -23,7 +23,7 @@ import { ReflagProvider } from "@reflag/vue-sdk"; ``` -Provider options forward Browser settings, including cache/storage, fallback values, offline/tracking, feedback, toolbar, credentials and API origins. `logger` takes precedence over `debug`. Live updates default to true; disable with `:enable-live-flag-updates="false"`. For an ordinary client-only Nuxt provider, wrap it in ``. +Provider options forward Browser settings, including cache/storage, offline/tracking, feedback, toolbar, credentials and API origins. `logger` takes precedence over `debug`. Live updates default to true; disable with `:enable-live-flag-updates="false"`. For an ordinary client-only Nuxt provider, wrap it in ``. ## `useFlag(key, defaultValue?)` @@ -126,4 +126,4 @@ declare module "@reflag/vue-sdk" { Registered flags get autocompletion for their keys and type checks for the defaults you pass. The checks happen at compile time only. To generate the declarations, run `npx reflag flags types` with the `vue` format. -Replace `const { isEnabled } = useFlag(key)` with `const enabled = useFlag(key)` (then `enabled.value` in script). Replace remote-config wrappers with separately authored multivariate flags and positional defaults, and move usage/feedback into their separate composables. If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data to v2 at the same time. If you generate type declarations, regenerate them with the v2 CLI. +Replace `const { isEnabled } = useFlag(key)` with `const enabled = useFlag(key)` (then `enabled.value` in script). Replace remote-config wrappers with separately authored multivariate flags and positional defaults, and move usage/feedback into their separate composables. Remove `fallbackFlags` and pass a default to each read instead, such as `useFlag("huddles", true)`. If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data to v2 at the same time. If you generate type declarations, regenerate them with the v2 CLI. From b6d0a9549424bed9403f6519bcf1d00bb9d8c723 Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:53:35 +0000 Subject: [PATCH 14/21] docs: use the same bootstrap migration note in every framework README --- packages/browser-sdk/README.md | 2 +- packages/react-native-sdk/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/browser-sdk/README.md b/packages/browser-sdk/README.md index 6a8cf6ce..31ac4ae3 100644 --- a/packages/browser-sdk/README.md +++ b/packages/browser-sdk/README.md @@ -147,4 +147,4 @@ Use `track(eventName, attributes?)`, `feedback(payload)` and `requestFeedback({ - Remove `fallbackFlags` and pass a default to each read instead, such as `getFlag("huddles", true)`. The default is returned whenever the flag has no value. - Replace wrapper overrides with `setFlagOverride(key, value)`; undefined clears, null is a value. - `getFlags()` now returns values and registers checks. Tooling should use `getFlagResults()`. -- Upgrade both ends of bootstrap to v2. Old Browser/framework clients remain incompatible with v2 bootstrap. +- If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data to v2 at the same time. diff --git a/packages/react-native-sdk/README.md b/packages/react-native-sdk/README.md index 479cd2f9..7bfce598 100644 --- a/packages/react-native-sdk/README.md +++ b/packages/react-native-sdk/README.md @@ -162,7 +162,7 @@ Mount this listener under a React Native provider. Context prop changes and `use - Replace remote-config wrappers with authored multivariate flags and positional JSON defaults. - Use `useFlagSuspense`, not `useFlag(key, { suspense: true })`, for readiness-waiting reads. - Remove `fallbackFlags` and pass a default to each read instead, such as `useFlag("huddles", true)`. The default is returned whenever the flag has no value. -- If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data at the same time as the app. +- If you bootstrap from the server, upgrade the Node SDK that produces the bootstrap data to v2 at the same time. - Rebuild against matching React Native/React/Browser v2 packages and regenerate legacy declarations. The [Expo](https://github.com/reflagcom/javascript/tree/main/packages/react-native-sdk/dev/expo) and [bare React Native](https://github.com/reflagcom/javascript/tree/main/packages/react-native-sdk/dev/bare-rn) examples use the v2 React Native APIs. OpenFeature providers are separate integrations and do not gain v2 support from this migration. From 328494c7828636e12a248edf933e97ce2e978cfd Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:55:38 +0000 Subject: [PATCH 15/21] docs: simplify bootstrap sections in framework READMEs --- packages/browser-sdk/README.md | 6 +++--- packages/react-native-sdk/README.md | 10 +++++----- packages/react-sdk/README.md | 8 ++++---- packages/vue-sdk/README.md | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/browser-sdk/README.md b/packages/browser-sdk/README.md index 31ac4ae3..8c69a2ec 100644 --- a/packages/browser-sdk/README.md +++ b/packages/browser-sdk/README.md @@ -101,11 +101,11 @@ Overrides apply after server evaluation and do not rewrite authored dependency r ## Server bootstrap -Generate the full payload with **Node SDK v2** on your server: +Get the bootstrap data from the Node.js SDK on your server: ```ts const bootstrappedState = serverClient.getFlagsForBootstrap(context); -// Send via your framework's safe JSON/hydration mechanism. +// Serialize this into the page with your framework's usual mechanism. ``` ```ts @@ -114,7 +114,7 @@ await reflag.initialize(); const enabled = reflag.getFlag("release"); ``` -The payload includes `protocolVersion: 2`, context, evaluated diagnostics/selections and an optional snapshot version. V1 payloads and the old `bootstrappedFlags` option are rejected. Preserve the entire envelope; do not pass just its `flags` property. A version is required for bootstrapped live updates. Later refreshes use browser-visible context and can differ from server-only evaluation; disable live updates when that is inappropriate. Requesting missing opt-in metadata still makes a browser-side request even when live updates are disabled. +Pass the whole object, not just its `flags`. Flags are then available immediately, without a network request. With live updates on, later refreshes evaluate flags using the browser's context, so values that depend on server-only attributes can change. Set `enableLiveFlagUpdates: false` if they must not. ## End-user opt-in diff --git a/packages/react-native-sdk/README.md b/packages/react-native-sdk/README.md index 7bfce598..12e77dc1 100644 --- a/packages/react-native-sdk/README.md +++ b/packages/react-native-sdk/README.md @@ -75,9 +75,9 @@ function Huddles() { A missing flag uses its default after initialization rather than suspending forever. Provider `suspense` and `useOptInFlags({ suspense: true })` control opt-in metadata loading, not ordinary flag reads. An object passed as `useFlag`'s second argument is a JSON default, not loading options. -## Bootstrap from Node v2 +## Bootstrap from the server -Produce the envelope on your server using Node SDK v2: +Get the bootstrap data from the Node.js SDK on your server: ```ts const flags = serverClient.getFlagsForBootstrap({ @@ -86,7 +86,7 @@ const flags = serverClient.getFlagsForBootstrap({ }); ``` -Pass the complete serialized envelope to the React Native provider: +Pass the whole object to `ReflagBootstrappedProvider`: ```tsx import { ReflagBootstrappedProvider } from "@reflag/react-native-sdk"; @@ -99,9 +99,9 @@ import { ReflagBootstrappedProvider } from "@reflag/react-native-sdk"; ; ``` -The envelope contains `protocolVersion: 2`, context, evaluated flags and an optional snapshot version. Legacy v1 bootstrap is rejected. Live updates require a snapshot version. Later refreshes use app-visible context and may differ from server evaluation. Disable live updates when later client evaluation must not replace the server result. Requesting missing opt-in metadata still makes a client-side request even with live updates disabled. +Flags are then available immediately, without a network request. With live updates on, later refreshes evaluate flags using the app's context, so values that depend on server-only attributes can change. Set `enableLiveFlagUpdates={false}` if they must not. -`ReflagClientProvider` accepts an externally initialized matching v2 client. Its lifecycle and platform-adapter configuration belong to your application; the React Native convenience providers do not configure an external client. +To use a client you create yourself, pass it to `ReflagClientProvider`. Your app is then responsible for initializing and stopping it, and for configuring its storage and live updates. ## Opt-in and feedback diff --git a/packages/react-sdk/README.md b/packages/react-sdk/README.md index 899763b8..fa89ca23 100644 --- a/packages/react-sdk/README.md +++ b/packages/react-sdk/README.md @@ -104,13 +104,13 @@ Registered flags get autocompletion for their keys and type checks for the defau ## Bootstrap and SSR -On the server, use Node SDK v2: +Get the bootstrap data from the Node.js SDK on your server: ```ts const flags = serverClient.getFlagsForBootstrap(context); ``` -Pass the **entire** safe, serialized envelope to the client provider: +Pass the whole object to `ReflagBootstrappedProvider`: ```tsx import { ReflagBootstrappedProvider } from "@reflag/react-sdk"; @@ -120,9 +120,9 @@ import { ReflagBootstrappedProvider } from "@reflag/react-sdk"; ; ``` -The envelope includes `protocolVersion: 2`, context, evaluated flag results and optional `flagStateVersion`. V1 bootstrap is rejected. Use a snapshot version for live updates; later refreshes use browser-visible context. Disable live updates if later browser evaluation must not replace server-only results. Requesting missing opt-in metadata still makes a browser-side request even when live updates are disabled. +Flags are then available immediately, without a network request. With live updates on, later refreshes evaluate flags using the browser's context, so values that depend on server-only attributes can change. Set `enableLiveFlagUpdates={false}` if they must not. -For a pre-existing Browser v2 client, use ``. The provider does not own its lifecycle; initialize/stop externally, except that a suspending read can start on-demand initialization. +To use a client you create yourself, pass it to `ReflagClientProvider`. Your app is then responsible for initializing and stopping it. ## Context, loading and events diff --git a/packages/vue-sdk/README.md b/packages/vue-sdk/README.md index 2b51b3de..e8790977 100644 --- a/packages/vue-sdk/README.md +++ b/packages/vue-sdk/README.md @@ -72,7 +72,7 @@ A context change clears old values while fetching. Late responses for previous c ## Bootstrap -On the server, use Node SDK v2 and your framework's safe serialization mechanism: +Get the bootstrap data from the Node.js SDK on your server, and serialize it into the page with your framework's usual mechanism: ```ts const flags = serverClient.getFlagsForBootstrap(context); @@ -84,9 +84,9 @@ const flags = serverClient.getFlagsForBootstrap(context); ``` -Pass the entire envelope (`protocolVersion: 2`, context, evaluated flags and optional snapshot version). Legacy v1 bootstrap is rejected. A snapshot version is required for live updates. Later refreshes use browser-visible context, so disable live updates when they must not replace server-only evaluations. Requesting missing opt-in metadata still makes a browser-side request even when live updates are disabled. +Pass the whole object to `ReflagBootstrappedProvider`. Flags are then available immediately, without a network request. With live updates on, later refreshes evaluate flags using the browser's context, so values that depend on server-only attributes can change. Set `:enable-live-flag-updates="false"` if they must not. -`ReflagClientProvider` accepts an externally initialized Browser v2 client. Its lifecycle belongs to the application. +To use a client you create yourself, pass it to `ReflagClientProvider`. Your app is then responsible for initializing and stopping it. ## Opt-in, tracking and feedback From 99b2f2d5a795cd2b3ba0d160f718d75299c2e053 Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Sat, 28 Nov 2026 18:56:42 +0000 Subject: [PATCH 16/21] docs: simplify flag read and check sections in framework READMEs --- packages/browser-sdk/README.md | 23 +++++++++-------------- packages/react-native-sdk/README.md | 12 +++++++----- packages/react-sdk/README.md | 20 +++++++++++--------- packages/vue-sdk/README.md | 14 ++++++++------ 4 files changed, 35 insertions(+), 34 deletions(-) diff --git a/packages/browser-sdk/README.md b/packages/browser-sdk/README.md index 8c69a2ec..9ac57ee0 100644 --- a/packages/browser-sdk/README.md +++ b/packages/browser-sdk/README.md @@ -29,29 +29,24 @@ Use only a **publishable** key in a browser. Secret keys belong on your server. ## Read flags ```ts -reflag.getFlag("release"); // boolean; missing/mismatched -> false +reflag.getFlag("huddles"); // true or false reflag.getFlag("model", "quick"); // string reflag.getFlag("limit", 10); // number -reflag.getFlag("settings", { model: "quick" }); -reflag.getFlag("nullable-settings", null); // FlagValue (arbitrary JSON) +reflag.getFlag("settings", { model: "quick" }); // { model: string } +reflag.getFlag("anything", null); // any JSON value ``` -- Defaults are positional JSON values; generation is not required for useful types. Primitive literals widen, and readonly defaults are accepted. -- A non-null default accepts only the same **top-level JSON category**: Boolean, number, string, array or object. A mismatch warns without logging the payload and returns the default. A bare read can never return a truthy object. -- Explicit `null` accepts any JSON value, including authored null. Missing values return null. -- Falsy selected values (`false`, `0`, `""`, null) are preserved when accepted by the requested category. -- Object fields and array elements are **not schema-validated**. Validate untrusted/nested payloads in your application. -- Values and defaults are returned as independent mutable copies. There are no reserved JSON property names. +Without a default, a read expects a Boolean and returns `false` if the flag is missing or isn't a Boolean. With a default, the read returns the default while flags load, or if the flag is missing or has a different JSON type. Pass `null` to accept any JSON value, then check its type before using it. -`getFlags()` returns a record of flag values (entries may be undefined) and registers checks for its returned roots. `getFlagResults()` returns owned evaluated diagnostics **without checks**; it is intended for tooling, not ordinary application reads. `getFlagsForBootstrap()` serializes protocol-v2 evaluated state without checks. +The SDK doesn't check object fields or fill in missing fields from your default. -## Checks and delivery +`getFlags()` returns all flag values as an object. -Calling a getter registers a requested-root check immediately, even if its return value is ignored. There are no `.isEnabled`, `.config`, `.value` or flag `.track()` wrappers. Delivery remains buffered through `/bulk` and identity-aware rate-limited. +## Checks -A selected check carries the authored selected key as `evalResult`, its `sourceVersionId` and the available snapshot `flagStateVersion`. Payload equality is not identity: equal-valued selections or segment-only snapshot changes remain distinguishable on subsequent reads. Defaults, category mismatches, local overrides and static fallback values do not fabricate authored selections. Diagnostics and bootstrap serialization generate no checks. The server evaluates dependencies; fetching their results does not itself register reads. +Each read records a check, which Reflag uses for launch monitoring. `getFlags()` records a check for every flag it returns. -`enableTracking: false` disables checks and user/company/usage tracking. `offline: true` skips HTTP and tracking. `await reflag.stop()` flushes buffered events and closes the client's background transports. +Set `enableTracking: false` to stop sending checks and events, or `offline: true` to skip all requests. `await reflag.stop()` sends pending events and closes the client's connections. ## Context, refresh and cache diff --git a/packages/react-native-sdk/README.md b/packages/react-native-sdk/README.md index 12e77dc1..c70dfde2 100644 --- a/packages/react-native-sdk/README.md +++ b/packages/react-native-sdk/README.md @@ -30,7 +30,7 @@ Use only publishable keys in the app, never server secret keys. React Native pro ## Read flags and track usage -`useFlag(key)` returns a **Boolean**, with false while initializing or when missing. A positional JSON default requests a matching top-level value category: +Pass a flag key to check whether it's enabled, or add a default to read another value: ```tsx import { Button } from "react-native"; @@ -50,13 +50,15 @@ function StartHuddleButton() { } ``` -A default sets the return type, even without generated declarations. Accepted false, zero, empty strings and null are not replaced by truthy fallbacks. Explicit `null` requests arbitrary JSON; `undefined` retains the Boolean-first behavior. Returned JSON values are independent copies. Defaults check top-level categories, not nested runtime schemas. +Without a default, a read expects a Boolean and returns `false` if the flag is missing or isn't a Boolean. With a default, the read returns the default while flags load, or if the flag is missing or has a different JSON type. Pass `null` to accept any JSON value, then check its type before using it. -Reading registers root checks immediately; application usage remains separate through `useTrack()`. `useClient().getFlags()` returns all flag values. `useIsLoading()` reports readiness separately. +The SDK doesn't check object fields or fill in missing fields from your default. + +Each read records a check, which Reflag uses for launch monitoring. Track usage with `useTrack()`. `useIsLoading()` returns whether flags are still loading. ## Suspense -Ordinary `useFlag` never suspends, even inside a provider with `suspense` enabled. Use `useFlagSuspense` to wait for initialization: +`useFlag()` never suspends. To wait for flags with Suspense, use `useFlagSuspense()`: ```tsx import { Suspense } from "react"; @@ -73,7 +75,7 @@ function Huddles() { ; ``` -A missing flag uses its default after initialization rather than suspending forever. Provider `suspense` and `useOptInFlags({ suspense: true })` control opt-in metadata loading, not ordinary flag reads. An object passed as `useFlag`'s second argument is a JSON default, not loading options. +If a flag is missing once flags have loaded, it returns the default. The provider's `suspense` prop applies only to `useOptInFlags()`. ## Bootstrap from the server diff --git a/packages/react-sdk/README.md b/packages/react-sdk/README.md index fa89ca23..1995ae54 100644 --- a/packages/react-sdk/README.md +++ b/packages/react-sdk/README.md @@ -26,7 +26,7 @@ Provider options forward Browser SDK settings, including `logger`, `debug`, `ena import { useFlag, useTrack } from "@reflag/react-sdk"; function Huddles() { - const enabled = useFlag("huddles"); // boolean, implicit false + const enabled = useFlag("huddles"); // true or false const settings = useFlag("huddle-settings", { maxParticipants: 10 }); const track = useTrack(); if (!enabled) return null; @@ -38,18 +38,20 @@ function Huddles() { } ``` -Bare reads return Boolean/false, including while initial data is unavailable. A default sets the return type, even without generated declarations: +Pass a default to read other values. The default sets the return type: ```ts useFlag("model", "quick"); // string useFlag("limit", 10); // number useFlag("settings", { model: "quick" }); // { model: string } -useFlag("nullable-settings", null); // FlagValue: arbitrary JSON +useFlag("anything", null); // any JSON value ``` -Non-null defaults enforce only the top-level JSON category (Boolean/number/string/array/object). Mismatches return the default and warn without logging the payload. Explicit null accepts authored null and all other JSON; missing values return null. Accepted false, zero and empty strings are preserved. Nested fields/elements are not schema-validated. Values/defaults are independent mutable copies; readonly defaults are accepted. +Without a default, a read expects a Boolean and returns `false` if the flag is missing or isn't a Boolean. With a default, the read returns the default while flags load, or if the flag is missing or has a different JSON type. Pass `null` to accept any JSON value, then check its type before using it. -`useFlag` never suspends. Its second argument is **payload data**, not `{ suspense: ... }` options; ordinary JSON has no reserved keys. Use the dedicated hook below for suspension. Use `useIsLoading()` or the provider's `loadingComponent` when you need an explicit loading UI. +The SDK doesn't check object fields or fill in missing fields from your default. + +`useFlag()` never suspends. To wait for flags with Suspense, use `useFlagSuspense()`. For a loading UI, use `useIsLoading()` or the provider's `loadingComponent`. ## `useFlagSuspense(key, defaultValue?)` @@ -67,15 +69,15 @@ function Model() { ; ``` -This hook has the same Boolean/default-based return types. It waits for initialization before reading. Once initialization settles, missing flags return their default rather than suspending forever. Bootstrap values can render immediately. Suspended attempts do not register a root read before data is ready. +It takes the same arguments as `useFlag()` and suspends until flags have loaded. If a flag is missing once they have, it returns the default. -The provider's existing `suspense` prop continues to configure **`useOptInFlags` only**. It does not change `useFlag`; `useFlagSuspense` is explicit. +The provider's `suspense` prop applies only to `useOptInFlags()`. ## Checks and usage tracking -A completed getter/hook read registers its requested-root check immediately, even if the value is ignored. Actual delivery remains buffered and identity-aware rate-limited by the Browser SDK. Checks contain selected variant/source/snapshot identity, not payloads. Defaults, category mismatches and local overrides never invent authored selections. Diagnostic/bootstrap inspection registers no checks. +Each read records a check, which Reflag uses for launch monitoring. -Application usage and feedback remain separate hooks: +Track usage and collect feedback with separate hooks: ```ts const track = useTrack(); diff --git a/packages/vue-sdk/README.md b/packages/vue-sdk/README.md index e8790977..11d747f4 100644 --- a/packages/vue-sdk/README.md +++ b/packages/vue-sdk/README.md @@ -31,7 +31,7 @@ Provider options forward Browser settings, including cache/storage, offline/trac