diff --git a/packages/node-sdk/README.md b/packages/node-sdk/README.md index 7e8c4568..d0d07a46 100644 --- a/packages/node-sdk/README.md +++ b/packages/node-sdk/README.md @@ -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: