Flipswitch

Quick Start

Get up and running with Flipswitch in 5 minutes

Quick Start

This guide will help you set up Flipswitch and evaluate your first feature flag.

Prerequisites

  • A running Flipswitch server (see Self-Hosting Guide or use our cloud)
  • Node.js 18+ or Java 17+

Create a Project and Environment

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

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

Create Your First Flag

  1. Navigate to Flags in your project
  2. Click Create Flag
  3. Enter a key (e.g., dark-mode) and select Boolean type
  4. Set the default value to false
  5. Click Create

Your flag is now created but disabled. Toggle it on to make it evaluate to true.

Generate an API Key

  1. Go to Settings > API Keys for your environment
  2. Click Create API Key
  3. Copy the generated key - you'll need it for SDK initialization

API keys are shown only once. Store them securely.

Install the SDK

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

Initialize and Evaluate

import { FlipswitchProvider } from '@flipswitch/sdk';
import { OpenFeature } from '@openfeature/web-sdk';
 
// Initialize the provider with your API key
const provider = new FlipswitchProvider({
  apiKey: 'YOUR_API_KEY'
});
 
// Register with OpenFeature
await OpenFeature.setProviderAndWait(provider);
 
// Get a client and evaluate flags
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. Go to the Flipswitch dashboard
  3. Toggle your flag on/off
  4. Watch your application update in real-time!

The SDK maintains an SSE connection and automatically receives flag changes.

Next Steps

On this page