Skip to content
Feature flags

Roll out features to the right users, decided offline

Typed flags targeted by plan, organisation, role, country or percentage, evaluated from the user's token in your API and the browser. Every flag has a kill switch and a change log.

Who it's for

For teams that ship every day

Product teams

Ship behind a flag, try it with one organisation, then roll it out by percentage.

Products with paid plans

Turn features on by plan or entitlement, from the same token that carries the subscription.

Whoever is on call

Switch a feature off for everyone in one click, or from an alert with a server key.

What it does

Flags that agree everywhere

Typed in your code

Declare flags once with defineFlags. A typo in a key fails to compile, in your API and your UI.

Target what the token knows

Plan, entitlement, billing status or country, organisation, org role, role, user, email domain or any claim.

Percentage rollouts

Stable buckets per user or per organisation: raising a rollout keeps everyone who was already in.

Evaluated offline

Signed rules are cached like the signing keys, so a check is no network call. Changes arrive within about 30 seconds.

Kill switch

Switch a flag off and everyone gets its default, from the dashboard or your backend.

Change log and promote

Every change kept with before and after. Promote copies flags from test to production, and new ones arrive switched off.

One token

Every check reads the same token

When a user signs in, their token carries who they are, their organisation and role, their plan and payment status, and what your flags target. Your API checks it in one guard, offline, and your UI reads the same answers.

Identitywho signed in, and howsub · amr
Rolesthe organisation and what it allowsorg.role
Billingthe plan and its payment statusbilling.plan
Flagswhat is switched on for this userflag()
In your code

Declare once, check in the API and the browser

The same evaluator runs in your API, the browser and the dashboard's preview, so a flag gives one answer everywhere. A flag the rules don't have gives its default; a check never throws.

flags.ts
// flags.ts: shared by your API and the browser
import { defineFlags } from '@anchring/auth/flags';

export const flags = defineFlags({
  'new-editor': { default: false },
  theme: { default: 'classic', variants: ['classic', 'compact'] },
});

// api.ts: evaluated from the token and the cached, signed rules
const auth = createAuth({ project: 'acme', env: 'prod', audience: 'acme-api', flags });

app.get('/api/editor', auth.guard({ flag: 'new-editor' }), openEditor); // 403 while it's off for this user
app.get('/api/settings', async (c) => c.json({ theme: await auth.flag('theme', c.var.user) }));
The plan

Which plans include it

Prices in euros, excluding VAT. Test environments include every feature on every plan.

Free €0

Included

Startup €29 a month

Included

Team €99 a month

Included

Scale €299 a month

Included

Enterprise from €2,000 a month

Included

Sovereign from €20,000 a year

Included

Questions

Before you start

Does a flag check call your servers?

No. The rules are fetched as a signed document and cached; each check is evaluated locally from the token and those rules.

Can I target something that isn't in the token?

Yes. Pass your own attributes with the check, such as the workspace the user is looking at. In a browser they are not signed, so keep data behind a server check.

Do I need Billing to target by plan?

Plan targeting reads the token's billing claim, which Billing fills in. Roles, organisations, users and percentages work without it.

Ship your next feature behind a flag

Declare a flag, add a rule in the dashboard and roll it out from the test environment.

Products

Auth

Hosted sign-in, organisations, roles and enterprise SSO.

Organisations

Teams, invites, custom roles and org switching, with the role in the token.

Billing

Plans, checkout, invoices and EU VAT, with the plan in the token.

Support chat

Talk to your users beside their plan, roles and flags.

Support access

Act as a user with a reason, a time limit and an audit trail.

Lead gen

Chat with visitors, and keep them when they sign up.