BETASDKs MIT, CLI and services Apache 2.0, schema engine BSL 1.1. Cloud is a closed beta: create an account to request access.
AUTH

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.

Closed beta: creating an account requests access. We email you when you are in.

schema/index.ts
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")
WHAT YOU GET

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.

ON CLOUD

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.

Closed beta: creating an account requests access. We email you when you are in.