Teams, roles and org switching, without building an admin panel
Users create organisations, invite colleagues and switch between them from inside your app. Each token speaks for one organisation and carries its role, so your API checks permissions offline, with a type for every one. Enterprise SSO and SCIM come per organisation.
Let a customer bring their team on day one: an organisation, invites and roles, with no members table of your own.
buildings
Selling to enterprises
Each organisation gets its own SAML or OIDC sign-in, verified email domains and members provisioned by their directory.
code
Developers
Permissions are strings you define once. A misspelt one fails to compile, and one guard checks them in your API.
What it does
Everything a team needs, in the token
users-three
Organisations in your app
Users create organisations, change roles and leave, through the SDK. Admins manage every organisation in the dashboard.
user-plus
Invites
Email invites are single use and tied to the address; links can be shared. Both expire, and both open a page of your app.
identification-badge
Custom roles
Owner, admin and member are built in. Add your own roles with the permissions they grant; members carry them in the token.
user-switch
Org switching
One call switches the active organisation for this session only. The next token speaks for the new organisation, and the others are listed for your switcher.
plugs
Enterprise SSO and SCIM per organisation
A SAML or OIDC connection per organisation, verified email domains, and members added and removed by their directory.
shield-check
Checked offline, typed
The organisation and its role are in the token. Your API verifies it with cached keys and one guard; the browser asks the same question with auth.can().
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
Create, invite and switch in the browser, check in your API
The browser client creates the organisation and invites a colleague with the user's own token. After the switch, the next token carries the organisation and the role, and your API's guard reads them offline.
// In the browser: the user creates an organisation, invites a colleague and switches to itconst org = await auth.orgs.create({ name: 'Acme' }); // the user is its ownerawait auth.orgs.invite(org.id, { email: 'bob@acme.example', role: 'admin' }); // mailed; or a linkawait auth.switchOrg(org.id); // the next tokens speak for Acme: user.org, user.orgRoleif (auth.can('members:manage')) showMembersPage(); // the same roles as the API's// access.ts: roles once, shared by your API and the browser; a misspelt permission fails to compileexportconst access = defineAccess({
roles: { member: ['report:read'], admin: ['report:*', 'members:manage'], owner: ['*'] },
});
// api/server.ts: the org and its role are in the token; one guard checks them offline
app.post('/api/members', api.require('members:manage'), addMember);
app.get('/api/orgs/:org/settings', api.guard({ org: (c) => c.req.param('org'), orgRole: ['owner', 'admin'] }), settings);
The plan
Which plans include it
Prices in euros, excluding VAT. Test environments include every feature on every plan.
Yes, when you turn it on in the project's settings. Otherwise admins create them in the dashboard. Either way, the user who creates an organisation is its owner.
How do custom roles reach my code?
A custom role names the permissions it grants, the same strings as your defineAccess roles. A member holding it carries them in the token, so your guards grant them without a new entry.
Can one user belong to several organisations?
Yes. Each token speaks for one, the active organisation, and lists the others so you can show a switcher. Switching changes this session only; the user's other sessions keep theirs.
Does single sign-on work per organisation?
Yes. Each organisation can have its own SAML or OIDC connection and verified domains, and SCIM keeps its members in step with the directory. Members a directory provisions stay the directory's.
Give your customers their team today
Turn on self-service organisations in the test environment, create one from your app and watch the role arrive in the token.