This is a demo Express app showcasing the @flagsync/node-sdk for feature flag usage.
- Type-safe flag evaluation
- Event tracking
- Real-time flag updates
- FlagSync CLI included (@flagsync/cli)
- Add your FlagSync SDK key to
.env:FLAGSYNC_SDK_KEY=your-key-here
To find this, navigate to the desired workspace environment from the Dashboard. Be sure to use a server-side SDK key.
- Install dependencies and start the dev server:
npm install npm run dev
- Visit http://localhost:3000/ to see the flag value.
- Toggle the flag in the Flags Dashboard and refresh to see changes.
Optional, but highly recommended
Run the FlagSync CLI to get full type safety and autocompletion when accessing flags:
npm run generate{
"flag": {
"key": "my-first-kill-switch",
"value": false
},
"algorithm": "v1-rules-based",
"result": [
"itemX",
"itemY",
"itemZ"
]
}For more detailed information about the SDK features and usage, visit: