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.
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.
Ship behind a flag, try it with one organisation, then roll it out by percentage.
Turn features on by plan or entitlement, from the same token that carries the subscription.
Switch a feature off for everyone in one click, or from an alert with a server key.
Declare flags once with defineFlags. A typo in a key fails to compile, in your API and your UI.
Plan, entitlement, billing status or country, organisation, org role, role, user, email domain or any claim.
Stable buckets per user or per organisation: raising a rollout keeps everyone who was already in.
Signed rules are cached like the signing keys, so a check is no network call. Changes arrive within about 30 seconds.
Switch a flag off and everyone gets its default, from the dashboard or your backend.
Every change kept with before and after. Promote copies flags from test to production, and new ones arrive switched off.
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.
sub · amrorg.rolebilling.planflag()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: 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) }));Prices in euros, excluding VAT. Test environments include every feature on every plan.
Included
Included
Included
Included
Included
Included
No. The rules are fetched as a signed document and cached; each check is evaluated locally from the token and those rules.
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.
Plan targeting reads the token's billing claim, which Billing fills in. Roles, organisations, users and percentages work without it.
Declare a flag, add a rule in the dashboard and roll it out from the test environment.
Hosted sign-in, organisations, roles and enterprise SSO.
Teams, invites, custom roles and org switching, with the role in the token.
Plans, checkout, invoices and EU VAT, with the plan in the token.
Talk to your users beside their plan, roles and flags.
Act as a user with a reason, a time limit and an audit trail.
Chat with visitors, and keep them when they sign up.