Quick Start
Get feature flags working in your app in under 5 minutes.
Prerequisites
- A Featsync account (free)
- Node.js 16 or later
-
Install the SDK
bash npm install @featsync/sdkbash pnpm add @featsync/sdkbash yarn add @featsync/sdk -
Get your API key
- Log in to the Featsync dashboard
- Go to API Keys in the sidebar
- Copy your Production API key (starts with
fs_)
-
Initialize the SDK
import { Featsync } from '@featsync/sdk';const featsync = new Featsync({apiKey: 'fs_your_api_key',}); -
Create a flag
- In the dashboard, go to Flags
- Click Create Flag
- Name it
new-featureand click Create
-
Use the flag in your code
if (await featsync.isEnabled('new-feature')) {// Show new featureshowNewFeature();} else {// Show old behaviorshowOldFeature();} -
Toggle it!
Go back to the dashboard, find your flag, and toggle it on. Your feature is now live!
That’s it!
You now have feature flags working in your app. Here’s what you can do next:
- Learn about percentage rollouts to gradually release features
- Set up multiple environments for staging and development
- Integrate with React using hooks