Quickstart
There are two parts: stand up the service once for your team, then read flags from your apps.
After that, adding a flag is one CLI command or one click, plus an if in your code.
1. Create the project
Section titled “1. Create the project”npm create flaghoist@latest team-flagscd team-flagsIt asks a few questions: the project name, where it will run, which storage to use, whether you
want accounts and roles, single sign-on, and the dashboard. Enter takes the default for each.
Accounts are on by default, so setup creates an AUTH_PEPPER, the secret your password hashes
depend on. It shows it once for your password manager and keeps it in a git-ignored .env.
This makes the team-flags directory and writes flaghoist.toml into it, which is the whole
project. Flaghoist runs as its own service rather than a library inside your app, so it wants a
directory of its own. If you already made an empty one, run npx flaghoist init inside it instead.
2. Deploy it
Section titled “2. Deploy it”npx flaghoist deployIt asks where you are deploying. Pick one of the two paths below.
Cloudflare Workers
Section titled “Cloudflare Workers”Choose Cloudflare Workers. The CLI installs what it needs, creates a KV namespace for your
flags, and deploys, so you end up with a URL like https://team-flags.<you>.workers.dev. It runs on
the free plan and costs nothing while nobody is reading flags.
Set the two secrets before your first write:
npx wrangler secret put ADMIN_TOKENnpx wrangler secret put READ_API_KEYUse long random values for both (openssl rand -hex 32). You do not need to set AUTH_PEPPER:
deploy copies it from .env onto the Worker.
Any other host
Section titled “Any other host”Choose Another platform. The CLI writes a small Node project (server.mjs, a Dockerfile and
package.json) that runs anywhere a container or Node runs: a VPS, Render, Fly.io, Railway, Cloud
Run, Kubernetes. It is configured entirely with environment variables. To try it on your machine
with flags kept in memory:
docker build -t team-flags .docker run -p 8080:8080 --env-file .env -e FLAGS_STORAGE=memory -e ADMIN_TOKEN=change-me-to-something-long -e READ_API_KEY=change-me-too team-flagsFor real use, point it at Postgres, Redis or SQLite with FLAGS_STORAGE and DATABASE_URL (or
REDIS_URL, or DATABASE_PATH), and add AUTH_PEPPER from .env to your host’s secrets. If you turned accounts off, there is no .env, so leave out --env-file .env. The Docker guide lists every variable, and
there are walkthroughs for Render, Fly.io and
Railway.
To skip the question, create the project with --platform container, or run
npx flaghoist deploy --target other.
Either way, that one URL now serves three things: the OFREP read API your apps use, the admin API,
and the dashboard at /admin.
3. Open the dashboard
Section titled “3. Open the dashboard”Go to /admin on your server and sign in with the admin token. Then open Account and create
your own account, which becomes the owner. From then on you sign in with your email, and you can
invite the rest of your team, each with their own role. If you turned accounts off,
the admin token is how you sign in.
4. Point the CLI at your service
Section titled “4. Point the CLI at your service”Flag commands need your server’s URL and a token. Export them once for the session:
export FLAGS_URL=https://flags.example.comexport FLAGS_ADMIN_TOKEN=<your admin token>With accounts on, npx flaghoist login signs you in instead and saves a personal token.
5. Create a flag
Section titled “5. Create a flag”npx flaghoist flag create new-checkout --desc "Redesigned checkout"Flags start off, so nothing changes for users until you turn one on. You can also click New flag in the dashboard. Neither needs a code change.
6. Read it in your app
Section titled “6. Read it in your app”Install the client (JavaScript shown; other languages use their own OFREP provider):
npm install @openfeature/web-sdk @flaghoist/vueRegister the provider once at startup:
import { OpenFeature } from '@openfeature/web-sdk'import { FlaghoistProvider } from '@flaghoist/vue'
await OpenFeature.setProviderAndWait( new FlaghoistProvider({ url: import.meta.env.VITE_FLAGS_URL, apiKey: import.meta.env.VITE_FLAGS_KEY, }),)OpenFeature.setContext({ targetingKey: user.id })Then use it anywhere:
<script setup lang="ts">import { useFeatureFlag } from '@flaghoist/vue'const newCheckout = useFeatureFlag('new-checkout')</script>
<template> <NewCheckout v-if="newCheckout" /> <LegacyCheckout v-else /></template>7. Release it
Section titled “7. Release it”Turn the flag on, roll it out to a percentage, or add a targeting rule, from the dashboard or the CLI. None of it needs a deploy:
npx flaghoist flag toggle new-checkout --onnpx flaghoist flag rollout new-checkout 25Users pick up the change the next time their app fetches flags.
Other languages
Section titled “Other languages”The read API is OFREP, so any language with an OpenFeature provider reads flags without a Flaghoist package. Each verified language has a guide with install steps and a working example: Go, Python, Java, .NET, Ruby, Rust and JavaScript / TypeScript. The overview covers the read key and evaluation context they share.
- Accounts and team access: invites, roles, single sign-on and two-factor codes.
- Environments: production and staging from one server.
- Self-hosting: what
flaghoist.tomlcontrols, and ejecting to your own code.