Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/node-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -653,14 +653,16 @@ To get type checked flags, install the Reflag CLI:
npm i --save-dev @reflag/cli
```

then generate the types:
then set up the CLI and generate the types:

```sh
npx reflag init
npx reflag flags types
```

This will generate a `reflag.d.ts` containing all your flags.
Any flag look ups will now be checked against the flags that exist in Reflag.
`npx reflag init` signs you in to Reflag and saves its settings in `reflag.config.json`. Choose `node` when it asks for the output format; the default, `react`, generates declarations for the React SDK instead. The types are generated in `gen/flags.d.ts` by default, so make sure your `tsconfig.json` includes that file.

Any flag look ups will now be checked against the flags that exist in Reflag. Run `npx reflag flags types` again when your flags change.

Here's an example of a failed type check:

Expand Down
Loading