Sign-in, enforced.
Auth is built into the Supatype server. Write access rules in your types. They decide who can read, write and delete, and the database enforces them.
export type Bookmark = Model<{ id: UUID owner_id: SupatypeAuthUserId post_id: UUID }, { access: { read: Owner<"owner_id"> create: LoggedIn delete: Owner<"owner_id"> } }>
-- what the read rule becomes USING ((SELECT _supatype.jwt_uid()) = "owner_id")
Every common sign-in, one set of rules.
Email, OAuth and MFA
Email and password, magic links, phone codes, anonymous users and OAuth with Google, GitHub, Apple and many more. MFA with TOTP authenticator apps.
Access rules in your types
Write rules as types, such as Owner<"author_id">, Role<"admin"> and LoggedIn. They compile to row level security policies, so REST and realtime follow the same rule.
Pre-built UI
@supatype/react-auth gives you sign-in and sign-up forms and OAuth buttons. The React Native package adds magic link and password reset screens.
Sessions handled
A one-hour access token and a refresh token that rotates. The client refreshes it before it expires, and @supatype/ssr reads the session on the server.
Auth settings such as OAuth providers, SMS and email delivery are set with environment variables on a local or self-hosted stack. A Cloud project cannot change them yet.
Every method, the token's claims and the configuration are in the Auth docs.
Rules the database keeps.
Cloud starts with 2 projects, 500 MB database and 1 GB storage, free and with no card.