Skip to content

Commit b43bf7d

Browse files
roncohenclaude
andcommitted
docs: drop bootstrap and tracking internals from Node guide
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 87c5d78 commit b43bf7d

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

‎packages/node-sdk/README.md‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ If the flag is missing or has a different JSON type, such as a string instead of
7272

7373
The SDK doesn't check object fields or fill in missing fields from your default.
7474

75-
`getFlags(context)` returns an object mapping flag keys to values. Unavailable flags can have an `undefined` value.
75+
`getFlags(context)` returns an object mapping flag keys to values.
7676

7777
Each read records a check, which Reflag uses for launch monitoring.
7878

@@ -172,21 +172,20 @@ Declarations are checked at compile time only. See the [Reflag CLI](https://docs
172172

173173
## Bootstrap the browser
174174

175-
**Requires a Browser, React or Vue SDK that supports the v2 bootstrap protocol.** V1 consumers expect a different flag shape and cannot use this result.
176-
177-
With a compatible v2 consumer, evaluate flags on the server to render them in the browser without waiting for a network request:
175+
To render flags in the browser without waiting for a network request, evaluate them on the server and pass the result to the Browser, React or Vue SDK's bootstrap option:
178176

179177
```ts
180178
const bootstrap = reflag.getFlagsForBootstrap(context);
181179
```
182180

183-
Pass the whole object to the compatible consumer's bootstrap option, serialized with your framework's usual mechanism. Do not pass it to a v1 SDK. Leave secrets and server-only attributes out of the context you bootstrap, because the browser can read it.
181+
Pass the whole object, serialized with your framework's usual mechanism. Leave secrets and server-only attributes out of the context you bootstrap, because the browser can read it.
184182

185183
## Remote evaluation
186184

187185
To evaluate flags on Reflag's servers instead of locally, use the remote methods:
188186

189187
```ts
188+
// Root client: key, default, user ID, company ID
190189
const model = await reflag.getFlagRemote("model", "quick", "user-1", "acme");
191190
const boundModel = await reflag
192191
.bindClient(context)
@@ -196,7 +195,7 @@ const values = await reflag.getFlagsRemote("user-1", "acme", {
196195
});
197196
```
198197

199-
Unlike `getFlag()`, `getFlagRemote()` on the root client takes the default before the user and company IDs. To read a Boolean, pass `undefined` as the default.
198+
To read a Boolean with the root client, pass `undefined` as the default.
200199

201200
## Edge runtimes
202201

@@ -239,15 +238,12 @@ Options can be set in the constructor, through environment variables, or in `ref
239238
| `batchOptions` | | Event batching: `maxSize`, `intervalMs` and `flushOnExit` |
240239
| `httpClient` | | Custom HTTP client |
241240

242-
To disable checks, automatic user/company updates and bound-client usage tracking for a context, pass `enableTracking: false` to reads or `bindClient()`, not to the constructor:
241+
To stop sending checks and events for a context, include `enableTracking: false` in it:
243242

244243
```ts
245-
reflag.getFlag({ ...context, enableTracking: false }, "new-editor");
246244
const untracked = reflag.bindClient({ ...context, enableTracking: false });
247245
```
248246

249-
Explicit calls to the root client's `track()`, `updateUser()` and `updateCompany()` remain separate operations and still send events.
250-
251247
## Shutting down
252248

253249
Before your process exits, call `await reflag.flush()` to send queued events, then `reflag.destroy()` to stop background work. `batchOptions.flushOnExit` flushes only when Node exits on its own; if you exit on a signal or call `process.exit()`, call `flush()` in your shutdown handler first.

0 commit comments

Comments
 (0)