A Chrome extension for self-hosted Flagsmith. See the flags for the current user and flip them for just yourself, without opening the dashboard and without touching anyone else's flags.
Every change is stored as a server-side identity override on your identity, never on the shared environment. Teammates, testers and production traffic are unaffected, and "Reset" (or the auto-reset timer) deletes the override so you fall back to the shared state.
Alice flips dark_mode for herself. Bob, and everyone else, still see the shared value.
| Alice (overridden) | Bob (unchanged) |
|---|---|
![]() |
![]() |
- The problem
- Try it in 3 commands
- What it does
- How it works
- Why this approach
- Project layout
- Security and permissions
- Testing
- Limitations
- Troubleshooting
- Roadmap
When you need to see a feature behind a flag in your local build or on staging, the usual routes are all bad:
- Open the Flagsmith dashboard, find the flag, flip it. Slow, a context switch every time, and it changes the flag for everyone using that environment. Teammates and QA suddenly see your experiment, or a half-finished feature.
- Edit code or local config. Doesn't reproduce what the real Flagsmith server returns, and has to be undone before you commit.
- Add a dev toolbar library to the app. Needs code changes in every app, and usually keeps overrides only in that one browser.
Flagsmith already has the right primitive: an identity override (a feature state attached to one identity). The missing piece is a fast, safe way to use it from the browser. That is this tool.
Requires Docker and Node 18+ (Chrome for the extension).
git clone https://github.com/NambertJones/flagsmith-devtools && cd flagsmith-devtools
docker compose up -d # Flagsmith on :8000, demo app on :8080
node scripts/seed.mjs # creates admin, project and demo flags, prints your keysThen load the extension:
- Open
chrome://extensions, enable Developer mode, click Load unpacked, pickextension/. - Click the toolbar icon (or open DevTools → Flagsmith tab) and paste the four values the seed
script printed (also saved in
devtools.config.json). Approve the host permission prompt. - Open the demo URL the seed script printed, tick
dark_modein the panel, and the page reloads with your override. Open the demo with&identity=bobto see that Bob is unaffected.
Dashboard login: admin@example.com / DevTools-demo-1234 (demo values only, change for real use).
scripts/seed.mjs is idempotent: it registers (or logs in as) the admin user, creates an organisation,
a project named Demo App, a Development environment (some versions don't create one automatically),
and four flags: new_checkout, dark_mode, welcome_banner (with a text value) and
max_items_per_page (with a numeric-looking value). It then writes the connection details to
devtools.config.json, which is git-ignored because it contains an admin token.
Panel (toolbar popup, and a Flagsmith tab inside Chrome DevTools)
- Lists every flag as evaluated for your identity (overrides applied), filterable by name.
- Toggle a flag, or edit its value, and the change is saved as an override for your identity only.
- Overridden flags are highlighted with an overridden badge and a per-flag Reset button.
- Reset all my overrides removes every override for your identity in one click.
- Optionally reloads the active tab after each change so the page picks up the new state.
Auto-reset (so you never forget an override)
- Choose 15 min / 1 hour / 8 hours / never (default 1 hour). Each override you create is scheduled for removal, and a background service worker deletes it on the server when the time comes.
- If the panel is open when that happens, it refreshes itself so it never shows stale state.
Auto-detect (no copy-pasting keys)
- With the DevTools Flagsmith tab open, the extension watches the page's own Flagsmith SDK requests and offers the API URL, environment key and identity it saw, with one click to fill them in. You only add your admin token.
| Credential | Used for | Where it goes |
|---|---|---|
| Environment key (client-side SDK key, safe to ship in a browser) | Reading flags | X-Environment-Key header |
| Admin API token (a Flagsmith user's token) | Creating and deleting overrides | Authorization: Token … header |
| Action | Endpoint |
|---|---|
| Flags as evaluated for you | GET /api/v1/identities/?identifier=<you> (environment key) |
| Shared baseline (no overrides) | GET /api/v1/flags/ (environment key) |
| Environment id | GET /api/v1/environments/<key>/ (admin token) |
| Find your identity | GET /api/v1/environments/<key>/identities/?q=<you> (admin token) |
| Create your identity if missing | POST /api/v1/environments/<key>/identities/ (admin token) |
| List your overrides | GET …/identities/<id>/featurestates/ (admin token) |
| Create / update an override | POST / PUT …/identities/<id>/featurestates/[<fs-id>/] (admin token) |
| Remove an override | DELETE …/identities/<id>/featurestates/<fs-id>/ (admin token) |
Writes only ever target …/identities/<id>/featurestates/, never the environment-level feature
states. A unit test asserts this.
- Look up your identity row (without creating it).
- In parallel: fetch the shared baseline, the flags evaluated for you, and your existing overrides.
- Merge them into rows: each flag shows its evaluated state, whether it is overridden, and the baseline it differs from.
- Make sure your identity exists (create it on first use, since overrides need a stored identity).
POSTa new override, orPUTthe existing one, with the feature id, enabled flag, value, the environment id and your identity id. An empty value is sent asnull.- Schedule its auto-reset (see below), then refresh the panel and optionally reload the tab.
Flagsmith's evaluation order puts identity overrides above segment overrides above the environment default, so your override wins for you and nobody else.
- Expiry entries (
overrideId,identityId, due time) live inchrome.storage.local. - The panel adds an entry when you create an override and removes it on reset, then pings the background service worker.
- The worker (
background.js) useschrome.alarmsto wake up at the next due time, deletes every due override via the API, and re-arms the alarm for the next one. - An override that is already gone (HTTP 404) counts as done. Any other failure is retried after a minute. The worker also sweeps on browser start-up and extension install.
devtools.jslistens tochrome.devtools.network.onRequestFinishedfor the inspected page, which needs no extra permissions.detect.jsrecognises/api/v1/identities/and/api/v1/flags/calls that carry anX-Environment-Keyheader, keeps any path prefix of a self-hosted install (for examplehttps://host/flagsmith), and reads the identity from theidentifierquery parameter or the JSON body. A later anonymous request never overwrites an identity that was already seen.
| In-app toolbars | Flagsmith DevTools | |
|---|---|---|
| Needs code changes in the app | Yes | No |
| Works on any site using Flagsmith (staging, a teammate's branch) | No | Yes |
| Override visible to your backend, mobile app and other browsers | No (local only) | Yes (stored on your identity) |
| Affects other users | No | No |
| Finds API URL, key and identity from the page's own traffic | No | Yes (DevTools tab) |
| Overrides auto-expire so you never forget one | No | Yes (default 1 hour) |
Because the override lives on the server, your backend services, mobile builds and other browsers that evaluate flags for the same identity see it too, which a local-only override can't do.
extension/ Chrome Manifest V3 extension (no build step, no dependencies)
manifest.json permissions: storage, tabs, alarms; optional host access
panel.html/js/css the UI (toolbar popup and DevTools tab share it)
api.js Flagsmith client: reads, identity lookup, override CRUD
expiry.js pure auto-reset bookkeeping
background.js service worker that removes expired overrides
detect.js infers API URL / key / identity from page requests
devtools.html/js registers the DevTools tab and runs auto-detect
docker-compose.yml self-hosted Flagsmith (Postgres) + a static demo app
scripts/seed.mjs bootstraps the local Flagsmith and writes devtools.config.json
demo/index.html tiny app that renders flags for an identity
test/ unit, live and real-Chrome end-to-end tests
.github/workflows/ CI: tests, manifest check, extension zip
- Host access is requested only for the API origin you configure, at runtime
(
optional_host_permissions), not for every site. - Other permissions:
storage(settings and the expiry list),alarms(auto-reset),tabs(reload the tab after a change). - The admin token is stored in
chrome.storage.localof your browser profile, unencrypted, like most extension settings. Use a token for a user who only has access to your dev/staging environment, not production. docker-compose.ymluses demo secrets (database password, Django secret key). Change them before exposing the stack anywhere.- Nothing is sent anywhere except to the Flagsmith API URL you configure.
npm test # unit tests: API client, detection, expiry (in-memory fake Flagsmith)
npm run test:live # the API client against your running local Flagsmith
npm run test:e2e # loads the real extension in Chrome and drives it against live Flagsmith
npm run icons # regenerate extension icons- Unit tests check that an override affects only the chosen identity, that updating uses
PUTinstead of creating a duplicate, that reset removes it, that writes never touch environment-level state, and that detection and expiry logic behave. - Live test repeats those checks against the real API.
- End-to-end test installs the actual extension into Chrome through the DevTools Protocol and checks that the panel renders the flags, that a UI toggle creates a server-side override and an expiry entry, that the background service worker removes an expired override, and that the open panel refreshes afterwards. It needs Chrome installed and the compose stack running.
CI runs the unit tests, validates the manifest and builds a zip of the extension on every push.
- Targets the default (core / Postgres) Flagsmith API. Edge-API deployments use different override endpoints and are not supported yet.
- Your identity must match the identifier your app passes to the Flagsmith SDK.
- Editing a flag sets its on/off state and its single value. Multivariate weights are not edited.
- Auto-reset runs from the browser, so it needs Chrome to be running when the timer fires. Overrides still expire later (or can be reset by hand) if it wasn't.
- Auto-detect needs the DevTools Flagsmith tab open while the page makes its Flagsmith calls.
- Local-evaluation SDKs that don't fetch identity overrides from the server won't see them.
| Symptom | Likely cause |
|---|---|
| "Permission to reach … was denied" | Approve the host permission prompt for your API URL, or press Save again. |
401 in the panel |
Wrong or expired admin token. Copy it again from the seed output or your Flagsmith profile. |
| Flags don't change on the page | The page's identity doesn't match the one in the panel, or the app caches flags. Check "Viewing as …". |
| Seed script can't connect | The stack isn't up yet. Check docker compose ps and docker compose logs flagsmith. |
| Flagsmith image fails to start | Make sure Docker has enough memory and ports 8000 and 8080 are free. |
- Edge-API (DynamoDB) identity overrides.
- Multivariate options and JSON value editing.
- "View as" other identities, with traits, to test segments.
- Publish to the Chrome Web Store.
MIT


