Skip to content

Commit c87d290

Browse files
committed
docs: use plain English for the bootstrap fix
1 parent badd715 commit c87d290

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

‎.changeset/bootstrap-public-flags-only.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"@reflag/node-sdk": patch
33
---
44

5-
Restrict direct and bound `getFlagsForBootstrap()` to flags explicitly marked public in the accepted definitions. Secret flag keys, values and legacy remote configuration remain available for server reads, but are no longer exported to clients. Own visibility across cached definitions and saved fallback snapshots.
5+
Keep secret flags and their remote config out of browser data returned by `getFlagsForBootstrap()`, including bound clients. They remain available on the server. The v1 data format does not change.
66

7-
Deploy the API visibility marker first and refresh persisted fallback snapshots. Older responses/snapshots without visibility, value-only fallbacks, and overrides for unknown or secret keys cannot authorize client exports. Overrides for known public flags remain supported. Bootstrap still includes the supplied context; pass only browser-safe attributes. The v1 bootstrap protocol is unchanged.
7+
Deploy the API change that adds `secret` to flag definitions before upgrading, then refresh saved fallback snapshots. Only flags marked `secret: false` are included. Older definitions without this field, fallback values without definitions, and overrides for unknown or secret flags are left out. Overrides for known public flags still work.
8+
9+
The browser can read the context you pass in. Leave out secrets and server-only attributes.

‎packages/node-sdk/README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,11 +379,13 @@ export const customFallbackProvider: FlagsFallbackProvider = {
379379

380380
## Bootstrapping client-side applications
381381

382-
The `getFlagsForBootstrap()` method is useful whenever you need to pass flag data to another runtime or serialize it without wrapper functions. Server-side rendering (SSR) is a common example, but it is also useful for other bootstrapping and hydration flows.
382+
Use `getFlagsForBootstrap()` to pass server-evaluated flags to a browser, for example when rendering a page on the server.
383383

384-
Bootstrap exports only flags explicitly marked public (`secret: false`) in the accepted definitions. Secret flags remain available to server reads, but their keys, values and remote configuration are excluded from bootstrap. Overrides for known public flags remain supported; overrides for unknown/secret keys and value-only fallbacks are excluded.
384+
Only public flags (`secret: false`) are included. Secret flags and their remote config stay on the server. Overrides for known public flags still work. Overrides for unknown or secret flags and fallback values without definitions are left out.
385385

386-
Deploy the API visibility marker before upgrading this SDK, and refresh saved fallback snapshots. Older responses/snapshots without visibility still support server evaluation, but cannot authorize bootstrap exports. The bootstrap context is still included: supply only browser-safe attributes, never credentials or server-only context.
386+
Deploy the API change that adds `secret` to flag definitions before upgrading this SDK, then refresh saved fallback snapshots. Older definitions without this field still work on the server, but are not included in browser data.
387+
388+
The browser can read the context you pass in. Leave out secrets and server-only attributes.
387389

388390
```typescript
389391
const client = new ReflagClient();

‎packages/node-sdk/src/client.ts‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,8 +1088,7 @@ export class ReflagClient {
10881088
}
10891089

10901090
/**
1091-
* Gets the evaluated flags for the current context without wrapping them in getters.
1092-
* This method returns raw flag data suitable for bootstrapping client-side applications.
1091+
* Get public flag data to send to a browser.
10931092
*
10941093
* @param options - The options for the context.
10951094
* @param options.enableTracking - Whether to enable tracking for the context.
@@ -1102,10 +1101,9 @@ export class ReflagClient {
11021101
*
11031102
* @remarks
11041103
* Call `initialize` before calling this method to ensure the flag definitions are cached, no flags will be returned otherwise.
1105-
* Only flags explicitly marked public in the accepted definitions are exported.
1106-
* Secret flags, unknown overrides and value-only fallbacks remain server-side.
1107-
* Older responses/snapshots without visibility cannot authorize client exports.
1108-
* The context is included; supply only browser-safe context attributes.
1104+
* Only flags marked `secret: false` are included. Secret flags, unknown overrides
1105+
* and fallback values without definitions are left out. Older definitions without
1106+
* the `secret` field are also left out. Include only browser-safe context attributes.
11091107
**/
11101108
public getFlagsForBootstrap({
11111109
enableTracking = true,

0 commit comments

Comments
 (0)