|
6 | 6 | "@reflag/vue-sdk": minor |
7 | 7 | --- |
8 | 8 |
|
9 | | -Add live flag updates and full bootstrapped state support to the browser-facing SDKs. |
| 9 | +Add live flag updates and full bootstrapped state support to the client-facing SDKs. |
10 | 10 |
|
11 | 11 | The browser SDK now supports `enableLiveFlagUpdates`, which subscribes to Reflag's SSE endpoint and refreshes flags automatically after live update notifications. The browser SDK keeps this disabled by default, while the React, React Native, and Vue SDKs enable it by default. |
12 | 12 |
|
13 | 13 | React Native now includes a built-in SSE transport via `react-native-sse`, so live updates work out of the box without requiring a global `EventSource` shim. |
14 | 14 |
|
15 | | -The browser SDK now accepts `bootstrappedState`, and the React, React Native, and Vue bootstrapped providers now accept the same full bootstrapped state object through their `flags` prop. The object contains `context`, evaluated `flags`, and an optional `flagStateVersion`. The Node SDK's `getFlagsForBootstrap()` now includes `flagStateVersion` when it is known, so you can pass the full object directly instead of deconstructing it first: |
| 15 | +The browser SDK now accepts `bootstrappedState`. The React, React Native, and Vue bootstrapped providers keep their existing `flags` prop, and that prop now accepts the same full bootstrapped state object. The object contains `context`, evaluated `flags`, and an optional `flagStateVersion`. Existing bootstrapped payloads shaped as `{ context, flags }` continue to initialize the SDK; the provider prop name has not changed. |
16 | 16 |
|
17 | | -```ts |
| 17 | +The recommended bootstrapping approach is now to pass the full object returned by the Node SDK's `getFlagsForBootstrap()` instead of deconstructing it first: |
| 18 | + |
| 19 | +```tsx |
18 | 20 | const bootstrappedState = serverClient.getFlagsForBootstrap(context); |
19 | 21 |
|
20 | 22 | const client = new ReflagClient({ |
21 | 23 | publishableKey, |
22 | 24 | bootstrappedState, |
23 | 25 | }); |
| 26 | + |
| 27 | +<ReflagBootstrappedProvider |
| 28 | + publishableKey={publishableKey} |
| 29 | + flags={bootstrappedState} |
| 30 | +> |
| 31 | + {children} |
| 32 | +</ReflagBootstrappedProvider>; |
24 | 33 | ``` |
25 | 34 |
|
26 | | -`flagStateVersion` is now preserved and used to avoid redundant refreshes immediately after bootstrapping, ignore stale bootstrapped payloads, and request the newest flag state after a live update. Bootstrapped live updates require a recent `@reflag/node-sdk` so `getFlagsForBootstrap()` includes `flagStateVersion`; otherwise the SDK will warn and disable live flag updates for that client. |
| 35 | +`flagStateVersion` is now preserved and used to avoid redundant refreshes immediately after bootstrapping, ignore stale bootstrapped payloads, and request the newest flag state after a live update. Bootstrapped live updates require a recent `@reflag/node-sdk` so `getFlagsForBootstrap()` includes `flagStateVersion`; otherwise the SDK will warn and disable live flag updates for that client. Existing unversioned bootstraps still work for initial rendering; set `enableLiveFlagUpdates={false}` if you intentionally use unversioned bootstrap data and want to avoid that warning. |
27 | 36 |
|
28 | | -Browser-facing SDKs now default SSE requests to `apiBaseUrl` and subscribe through `https://front.reflag.com/sse/client?publishableKey=...`. SSE requests include the publishable key and SDK version. `sseBaseUrl` remains available as a temporary compatibility override if you still need a separate pubsub host. |
| 37 | +Browser-facing SDKs now default SSE requests to `apiBaseUrl` and subscribe through `https://front.reflag.com/sse/client?publishableKey=...`. SSE requests include the publishable key and SDK version. `sseBaseUrl` remains available as a temporary compatibility override if you need a separate SSE host. |
29 | 38 |
|
30 | 39 | The Node SDK now uses Reflag's server push SSE endpoint (`GET https://front.reflag.com/sse/server`) for live flag definition updates. If you override `flagsPushUrl`, the SDK will open that URL with the same authenticated streaming GET behavior. |
0 commit comments