Quickstart
This guide walks you through getting started with Replane, creating your first config, and reading it from your application.
Choose your deployment
☁️
Replane Cloud
Start instantly. No infrastructure to manage. Free tier available.
🏠
Self-Hosted
Run on your infrastructure with Docker. Full control over your data.
Option A: Replane Cloud
- Sign up at cloud.replane.dev
- Create your first config (e.g.,
feature-new-checkoutwith valuefalse) - Create an SDK key in the SDK Keys page
- Connect your app — skip to Step 4: Install the SDK
app.ts
import { Replane } from '@replanejs/sdk'
const replane = new Replane()
await replane.connect({
sdkKey: process.env.REPLANE_SDK_KEY,
baseUrl: 'https://cloud.replane.dev'
})
const newCheckoutEnabled = replane.get('feature-new-checkout')
Option B: Self-Hosted
Prerequisites
- Docker and Docker Compose installed
- Node.js 18+ (for the SDK)
Step 1: Deploy Replane
Create a docker-compose.yml file:
docker-compose.yml
services:
postgres:
image: postgres:17
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: replane
volumes:
- replane-data:/var/lib/postgresql/data
replane:
image: replane/replane:latest
depends_on:
- postgres
ports:
- '8080:8080'
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/replane
BASE_URL: http://localhost:8080
SECRET_KEY: change-me-to-a-long-random-string
PASSWORD_AUTH_ENABLED: true
volumes:
replane-data:
Generate a secure SECRET_KEY:
openssl rand -base64 48
Start Replane:
docker compose up -d
Open http://localhost:8080 in your browser.
Step 2: Create a config
- Navigate to configs page in your project
- Click New Config
- Enter the config details:
- Name:
feature-new-checkout - Value:
false
- Name:
- Click Create
You've created your first feature flag.
Step 3: Create an SDK key
- Go to SDK Keys in the project sidebar
- Click Create SDK Key
- Select your environment (e.g., "Production")
- Copy the generated key — you'll need it in the next step
caution
SDK keys are shown only once. Store them securely.
Step 4: Install the SDK
npm install @replanejs/sdk
Step 5: Read the config
app.ts
import { Replane } from '@replanejs/sdk'
const replane = new Replane()
await replane.connect({
sdkKey: process.env.REPLANE_SDK_KEY,
baseUrl: 'http://localhost:8080'
})
// Read the feature flag
const newCheckoutEnabled = replane.get('feature-new-checkout')
console.log('New checkout enabled:', newCheckoutEnabled) // false
// Subscribe to changes
replane.subscribe('feature-new-checkout', (config) => {
console.log('Feature flag changed:', config.value)
})
Step 6: Update the config
- Go back to the Replane dashboard
- Click on
feature-new-checkout - Change the value to
true - Click Save
Your application receives the update instantly via Server-Sent Events. Check your console — you should see:
Feature flag changed: true
Next steps
- Add override rules to return different values based on user context
- Learn about gradual rollouts to release features to a percentage of users
- Configure authentication for self-hosted production deployments