Skip to content

Getting Started

Lionel Serrao edited this page Nov 29, 2026 · 1 revision

Getting Started

About 5 minutes. You need Docker, Node.js 18+ and VS Code 1.90+. Commands work the same on macOS, Linux and Windows unless marked.

flowchart TB
    A["1. docker compose up<br/>(Flagsmith on :8000)"] --> B["2. node setup.mjs<br/>(account, project, flags,<br/>A/B test, API key)"]
    B --> C["3. Install the .vsix"]
    C --> D["4. Connect in VS Code<br/>(paste the key)"]
    D --> E["Open demo-app/src/checkout.ts"]
Loading

1. Start open-source Flagsmith

git clone https://github.com/DaZeDLooN/flag-responder.git
cd flag-responder/self-hosted
docker compose -p flag-responder up -d

This runs Flagsmith 2.295.2 (pinned) with Postgres on http://localhost:8000, with Experimentation switched on. The first start downloads the images, so give it a few minutes.

2. Create the demo in one command

cd ../demo-app
node setup.mjs

It waits for Flagsmith, then:

  • signs up an admin account;
  • creates the Flag Responder Demo project with Development and Production;
  • creates an organisation API key;
  • loads the demo flags: a segment override for staff, and an A/B test with simulated shopper traffic so there are results to show.

At the end it prints the dashboard login and the API key. Keep both private.

3. Install the extension

Download flag-responder-v<version>.vsix from the latest release, then:

code --install-extension flag-responder-v0.7.2.vsix

Or, in VS Code: Extensions view → … menu → Install from VSIX.

4. Connect

Open the demo-app folder in VS Code. In the Command Palette, run Flag Responder: Connect to Flagsmith. Keep http://localhost:8000 and paste the key. The key goes into VS Code's secret storage (your OS keychain), never into settings or files.

Open src/checkout.ts: each flag check now shows its live state above it.

5. Try an incident

The demo scripts need the key in your terminal:

# macOS / Linux
export FLAGSMITH_API_KEY=<your key>
# Windows PowerShell
$env:FLAGSMITH_API_KEY="<your key>"

node simulate-incident.mjs unhealthy   # monitoring reports new_checkout broken in Production
node simulate-incident.mjs healthy     # ...and fixed again
node seed.mjs                          # put the demo back to its starting state

Then follow The Incident Loop.

Settings worth knowing

Setting Default What it does
flaglens.pollSeconds 15 How often Flag Responder checks Flagsmith. Use 5 for demos; 0 turns polling off
flaglens.codeLens true Show flag state above each flag check
flaglens.confirmToggle production When to ask before toggling a flag
flaglens.extraPatterns [] Regular expressions that find flag keys in your own wrapper functions (first capture group = the key)

Settings start with flaglens., the project's earlier name, so older settings keep working.

If something doesn't show up

  • No flag states above the code: check that the status bar says Flag Responder Demo · <environment>. If it says Connect Flagsmith, click it.
  • An alert takes a while: Flag Responder checks every pollSeconds; Flagsmith can't push to it.
  • Docker port 8000 is busy: change the port in self-hosted/docker-compose.yml and connect to that address instead.

Clone this wiki locally