Getting Started

Quick Start

Create and evaluate your first feature flag

Get from zero to evaluating flags in your app.

Create a Project and Environment

  1. Log into the Flipswitch dashboard
  2. Create a Project (e.g., "My App")
  3. Create an Environment (e.g., "Development")

Each environment is isolated - flags can have different values per environment.

Create Your First Flag

  1. Navigate to Flags in your project
  2. Click Create Flag
  3. Enter a key: dark-mode
  4. Select Boolean type
  5. Set default value to false

Your flag exists but is disabled. Toggle it on to return true.

Get Your API Key

Each environment automatically gets an API key when created. Find it in the Environments tab:

  1. Click on your environment
  2. Copy the token from the API Key section

Keep your API key secure. If compromised, use Rotate Key to generate a new one. The old key stays valid for 24 hours during rotation.

Install the SDK

npm install @flipswitch/sdk @openfeature/web-sdk

Evaluate Flags

import { FlipswitchProvider } from '@flipswitch/sdk';
import { OpenFeature } from '@openfeature/web-sdk';
 
const provider = new FlipswitchProvider({
  apiKey: 'YOUR_API_KEY'
});
 
await OpenFeature.setProviderAndWait(provider);
const client = OpenFeature.getClient();
 
const darkMode = await client.getBooleanValue('dark-mode', false);
console.log(`Dark mode: ${darkMode}`);

Test Real-Time Updates

  1. Run your application
  2. Toggle the flag in the dashboard
  3. Watch your app update instantly

The SDK maintains an SSE connection and receives flag changes in real-time.

Next Steps

On this page