Skip to main content
A world’s Supabase project is a Postgres database built from the app’s own supabase/migrations and supabase/seed.sql. The Data API, Auth and Storage answer the official @supabase/supabase-js client, and the app’s row-level security policies decide every request. The Supabase mock page has a scene and checks you can copy. Select this tool with twins: [supabase] in a scene or --tools supabase when creating a world. Inspect its API coverage and connection code:

Connect

Node
A server route acts as the signed-in person by passing their access token:
Node

The database

Ancha builds each world’s database the way supabase db reset does: the files in supabase/migrations in file-name order, then supabase/seed.sql, then the scene’s seed.supabase. When the scene gives migrations or seed_sql inline, those are used instead of the project’s files. A migration that fails stops the run and names its file and line. The project starts with the auth, storage and extensions schemas, the roles anon, authenticated and service_role, and uuid-ossp and pgcrypto in extensions. Migrations can also create citext and pg_trgm. Triggers on auth.users, such as one that creates a profile row for each new person, run on sign-up and for every seeded user. Every Data API and Storage request runs in Postgres as the caller’s role, with the JWT claims that auth.uid(), auth.role() and auth.jwt() read. The app’s policies decide what each person sees and changes. now(), token lifetimes, code expiry and signed URL expiry follow the world’s clock.
Seeded users are created the way sign-up creates them: a row in auth.users and an email identity. confirmed defaults to true; created and last_sign_in are offsets from the scene’s start, such as -900h. sql runs as the database owner after the users exist. A file’s bucket can come from buckets or from one of the app’s migrations.

Sign people in

Auth answers supabase.auth and supabase.auth.admin: sign-up, password sign-in, email codes and magic links, PKCE, refresh token rotation, sign-out, password recovery, email change and the admin API. Sign-up asks the person to confirm their email by default. Codes, links, confirmations and invitations arrive in the world’s inbox; read them with ancha world inbox. A scene calls the app as a person with as on an app call:
The world signs the person in and sends the call with their access token in Authorization. From a harness, ancha world act supabase.sign_in --env <id> --args '{"email":"alice.romero@kilnstreet.example"}' returns an access_token, a refresh_token and the authorization header value.

Storage

Buckets keep their public flag, file_size_limit and allowed_mime_types. Uploads, downloads, lists, moves, copies and removals run as the caller against the policies on storage.objects; a file’s owner is the uploader’s user id. Public buckets serve files at /object/public/... without a key. Signed download and upload URLs are JWTs signed with the project secret and expire on the world’s clock.

Endpoints

Data API

Accept: application/vnd.pgrst.object+json (.single()) and text/csv (.csv()) are answered as PostgREST answers them, and errors carry PostgREST’s code, details, hint and message.

Auth

Storage

Starter data

Inspect the starter records and the fields you can use in a scene:
The first command prints the starter dataset. The second lists accepted seed fields and the built-in check examples. A scene uses the data you put in its seed field, and the tables come from the app’s migrations. The supabase-starter dataset is a client portal for an accounting firm, Brightwell CPA: Maria Okafor on the firm’s staff, Tom Reyes and Jen Park at Harborview Dental, and Sam Adeyemi at Northgate Bakery, whose email is not confirmed. The private documents bucket holds Harborview Dental’s Q3 payroll CSV and its engagement letter; the public avatars bucket takes PNG and JPEG images. A document_requests table asks Tom for the Q4 payroll file. Row-level security shows each person their own requests, and Storage policies let Tom and Jen read and upload files in the harborview-dental/ folder.

Checks

State checks read the database and the stored files at the end of a run, as the database owner, so policies hide nothing. In where, { user: <email> } stands for that person’s user id:
supabase.rows takes count, count_gte or count_lte; supabase.objects takes a path or a prefix, with count, size, sha256 and owner; supabase.users takes exists, confirmed and signed_in. inbox.messages counts the codes and links a person received. The supabase.sql action runs SQL as the database owner during a run, for example an administrator changing someone’s role. world_rules.call_faults fails Supabase calls with a 5xx error or a 429, such as match: "POST /storage/v1/object/{bucket}/{path*}" for uploads.