# Sypnia Data documentation > Sypnia Data is an open-source Postgres backend: sign-in, tables, an API and SQL, ready for people and for AI agents. It runs on any Postgres, and you write your app with the ORM you want: plain SQL, Prisma, Drizzle, or Sypnorm with Sypnia Cases. Every page of the documentation follows, in reading order. Each one starts with its title and its address. --- ## Start here > What Sypnia Data is, how it works, what is open source and what is Sypnia Cloud, and the quickstarts. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://data.docs.sypnia.com/start/ For agents: Section index for Sypnia Data: an open-source Postgres backend (auth, Data API, SQL, row-level security, MCP; any ORM) that runs on any Postgres 14+, self-hosted or in Sypnia Cloud. Read what-it-is, how-it-works, open-source-and-cloud, then a quickstart; how-sypnia-uses-it shows Sypnia's own accounts and Telemetry on Data. Sypnia Data gives an app its backend: people sign up and sign in, your tables get an API, you run SQL, and AI agents can do all of it too. It runs on **any Postgres**, and you write your app with any ORM, or none. > **Note: Sypnia uses it too** > > Every Sypnia product signs people in with Sypnia Data: one Sypnia account for Telemetry, the App and the rest of the suite. Telemetry, the pilot, keeps its web app's database in it. [How Sypnia uses it](https://data.docs.sypnia.com/start/how-sypnia-uses-it). There are two ways to run it, and every page says which one it is about: - **\[Engine]** **The Sypnia Data engine** is open source (AGPL-3.0; the `@sypnia/data` package is MIT). You run it next to your own Postgres, for free. - **\[Cloud]** **Sypnia Cloud** runs the same engine for you, with the console, managed databases, accounts and Sypnia Mail as an e-mail provider. --- ## What Sypnia Data is > An open-source Postgres backend with auth, an automatic API, SQL and row-level security, made for people and for AI agents, with any ORM. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://data.docs.sypnia.com/start/what-it-is/ For agents: Read this to understand what Sypnia Data offers: auth (e-mail, passwords, magic links, Google/GitHub, sessions with configurable lifetime including never), machine auth (OAuth client credentials, DPoP, device flow, PATs, API keys, MCP), the Data API (PostgREST-compatible REST over your schema), SQL and migrations, row-level security and @sypnia/data (client SDK), with any ORM (Sypnorm, the use-case ORM, comes with Sypnia Cases). Runs on any Postgres 14+. Sypnia Data is the backend of your app, built on the database you already trust: Postgres. You get five things, and you can use any of them alone. | What | In one line | Read | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- | | **Auth** | Sign-up, sign-in, e-mail confirmation, passwords, magic links and codes, Google and GitHub (SSO), sessions you control (down to «never expires») | [Auth](https://data.docs.sypnia.com/auth) | | **Machines and agents** | OAuth 2.0 for services, CLIs and AI agents: key pairs, DPoP, the device flow, personal access tokens, API keys, an MCP server | [Machines and agents](https://data.docs.sypnia.com/machines) | | **The Data API** | Every table and view of your schema as REST, filtered and sorted in the URL, under your row-level security | [The Data API](https://data.docs.sypnia.com/data/rest-api) | | **SQL** | Run queries and migrations over HTTPS, for servers, the console and agents | [SQL and migrations](https://data.docs.sypnia.com/data/sql-and-migrations) | | **Any ORM** | Plain SQL, Prisma, Drizzle, or Sypnorm (the use-case ORM, with Sypnia Cases), on the same tables | [Use any ORM](https://data.docs.sypnia.com/data/any-orm) | ### Who it is for - **People building an app at any level.** A beginner gets sign-in and a database without writing a server. A senior gets plain Postgres, SQL, migrations and standard OAuth, with nothing hidden. - **AI agents.** Everything you can do in the console you can do through the API, and agents sign in with standard protocols, not with a password you paste into a chat. - **Teams leaving Supabase or Firebase.** The auth API keeps GoTrue's shape, the Data API keeps PostgREST's query syntax, and `auth.uid()` works in your policies, so most code moves with small changes. ### Any Postgres, no lock-in The engine installs its own schemas (`sypnia_auth`, `sypnia_data`) and roles in **your** database and never asks for a superuser. Your tables are ordinary tables: read them with `psql`, Prisma, Drizzle or anything else, back them up with `pg_dump`, move them whenever you want. [Any Postgres](https://data.docs.sypnia.com/data/any-postgres) lists what the engine needs. ### What it is not - **Not a database host by itself.** The engine needs a Postgres. Sypnia Cloud can create one for you; self-hosted, you bring yours. - **Not file storage.** Files and images are Sypnia Files, a separate product. - **Not a hosted login page.** Your app shows its own sign-in screens; the engine sends the e-mails and handles the links. Sypnia Cloud's console has ready screens you can copy. - **Not a realtime bus.** Data does not stream database changes to browsers: your app reads through the Data API when it needs to. --- ## How it works > The path of a sign-up, a sign-in and a query, from your app through the engine to your database, and where each decision is made. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://data.docs.sypnia.com/start/how-it-works/ For agents: Read this for the end-to-end flow: the app calls https://.data.sypnia.com with a publishable key; sign-up creates a user and sends a confirmation e-mail; verifying the link returns an access token (EdDSA JWT) and a refresh token; every Data API request runs in one Postgres transaction with SET LOCAL ROLE and request.jwt.claims so row-level security applies; machines use OAuth tokens the same way. Your app talks to one address per project, `https://.data.sypnia.com` (or your own domain when you self-host). Behind it there is one program, the engine, and your Postgres. **Figure**: The parts of Sypnia Data. Apps, agents and the console call the engine; the engine is one Rust binary with five modules; everything it keeps lives in your Postgres. 1. Your app, with `@sypnia/data` or any ORM, sends a publishable key and, once signed in, the user's access token. 2. Agents and services sign in with OAuth (key pairs, DPoP, the device flow) or a personal access token. 3. Auth checks credentials, keeps sessions, signs tokens and sends e-mails through your provider. 4. The Data API turns a URL into one SQL statement and runs it as the caller's database role. 5. Postgres holds everything: your tables, the `sypnia_auth` schema and the rules that decide who sees which row. ### A sign-up, step by step #### 1. Your app calls sign-up `sypnia.auth.signUp({ email })` sends `POST /auth/v1/signup` with the publishable key. The engine checks the rate limits and, if you turned it on, the CAPTCHA. #### 2. The engine creates the user and sends the e-mail A row in `sypnia_auth.users`, unconfirmed. A one-time token, stored only as a hash, goes in an e-mail through the project's e-mail provider: a link and a 6-digit code. #### 3. The person opens the link `GET /auth/v1/verify` checks the token, confirms the e-mail and redirects to your app with a session in the address fragment. Without a password yet, your app shows «create your password». #### 4. Your app holds a session An **access token** (a JWT signed with the project's Ed25519 key, one hour by default) and a **refresh token** (rotated on every use). The SDK renews the access token a minute before it expires. ### A query, step by step `sypnia.from('orders').select('id, total')` becomes `GET /rest/v1/orders?select=id,total`. The engine: 1. reads the key or token and decides the **database role**: `anon`, `authenticated` or `service_role`; 2. opens a transaction in your database, runs `SET LOCAL ROLE authenticated` and stores the token's claims in `request.jwt.claims`; 3. runs one SQL statement; your [row-level security](https://data.docs.sypnia.com/data/row-level-security) policies, which call `auth.uid()`, keep only the rows this user may see; 4. commits and returns JSON. The engine never filters rows itself: Postgres does. That is why the same rules hold whether a request comes from the Data API, from an ORM on your server or from an agent. ### Where each decision is made | Decision | Made by | | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | | Is this password right, is this link valid, may this client get a token | The engine (Rust) | | How long a session lives | Your project's [session policy](https://data.docs.sypnia.com/auth/sessions-and-tokens) | | Which rows a user sees or changes | Your database, through row-level security | | What your app does for a person | Your code, with any ORM or none ([Use any ORM](https://data.docs.sypnia.com/data/any-orm)) | --- ## Open source and Sypnia Cloud > What the open-source engine includes, what Sypnia Cloud adds on top, and why your data stays portable either way. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://data.docs.sypnia.com/start/open-source-and-cloud/ For agents: Comparison of the Sypnia Data engine (AGPL-3.0; @sypnia/data MIT; self-hosted, any Postgres) and Sypnia Cloud (hosted engine + console, managed databases, Sypnia Mail as an auth e-mail provider, accounts and organizations, plans). The engine and @sypnia/data are open source; the console and Cloud's control plane are not. Sypnia Data is one engine. You can run it yourself, or let Sypnia Cloud run it. The API is the same in both, and so is your data. | | Sypnia Data engine (open source, on any postgres) | Sypnia Cloud (hosted by us, with a free tier) | | ------------------------------------ | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | The engine: auth, Data API, SQL, MCP | Open source, AGPL-3.0. One Rust binary or a Docker image. | The same engine, run by us, kept up to date. | | Database | Yours: any Postgres 14+ by connection string. | A managed database per project, or yours by connection string. | | E-mail for auth | Your provider: SMTP, Resend, Postmark or your own Amazon SES, or the engine's own sender. | Your provider, or **Sypnia Mail** from your own domain, paid with credits. Sypnia sends no e-mail of its own for your project. | | Managing it | The API, the SQL endpoint, the CLI and the MCP server. | Also **the console**: table editor, SQL editor, users, machines, the link to Cases, settings. | | Accounts | None: the engine serves projects; whoever holds a secret key manages them. | Sypnia accounts, organizations, members and roles. | | @sypnia/data | Open source (MIT). | The same package. | | Price | Free. You pay your servers. | A free tier, then prepaid plans or credits. | ### What is open, exactly - **Open source**: the engine (`sypnia-data`), the package `@sypnia/data` (client, server and the CLI), the SQL the engine installs, the OpenAPI contract and these docs' examples. - **Not open**: Sypnia Cloud's console and its control plane (organizations, projects, billing, provisioning of managed databases). ### Leaving is a database dump Your tables are plain Postgres tables, and users live in the `sypnia_auth` schema of the same database. Moving from Sypnia Cloud to your own servers is `pg_dump`, `pg_restore` and pointing an engine at the new database: the signing keys move with the project, so signed-in people stay signed in. --- ## Quickstart: Sypnia Cloud > Create an account and a project, make a table with row-level security, sign up a first user and read their rows from your app. Applies to: Sypnia Cloud (paid service). Source: https://data.docs.sypnia.com/start/quickstart-cloud/ For agents: Ten-minute Sypnia Cloud quickstart: sign up at data.app.sypnia.com (e-mail first, then create a password), create an organization and a project (managed database), copy the publishable key, create a table with RLS in the SQL editor, install @sypnia/data, sign up a user and query their rows. In ten minutes you have a project with a table, a signed-up user and your app reading that user's rows. #### 1. Create your account On [data.sypnia.com](https://data.sypnia.com) choose **Start free**, write your name and your e-mail. An e-mail arrives: «Confirm your e-mail and create your password». Open it, choose a password, and you are in. #### 2. Create a project The console asks for an organization name and your first project. Pick **Managed database** (we create it for you) or **My own Postgres** (paste a connection string: [Any Postgres](https://data.docs.sypnia.com/data/any-postgres)). When it is ready you see its address and two keys: - the **publishable key** `syp_pk_…`, for your app; - a **secret key** `syp_sk_…`, for servers only. Keep it out of your code. #### 3. Create a table with row-level security Open **SQL** in the console and run: ```sql create table public.notes ( id uuid primary key default gen_random_uuid(), owner uuid not null default auth.uid() references sypnia_auth.users(id) on delete cascade, body text not null, created_at timestamptz not null default now() ); alter table public.notes enable row level security; create policy "own notes" on public.notes for all to authenticated using (owner = auth.uid()) with check (owner = auth.uid()); ``` #### 4. Install the SDK ```bash npm install @sypnia/data ``` `src/sypnia.ts` ```ts import { createClient } from '@sypnia/data/client'; export const sypnia = createClient('https://.data.sypnia.com', 'syp_pk__…'); ``` #### 5. Sign up, then write and read Sign-up by e-mail sends a confirmation, and Sypnia doesn't send e-mail for your project: first set [your own provider](https://data.docs.sypnia.com/auth/email-providers-and-templates#without-a-provider) in **Auth → E-mail sender** (SMTP, Resend, Postmark or SES), or turn on Google or GitHub. Until then `signUp` answers `email_provider_required`. ```ts await sypnia.auth.signUp({ email: 'ana@example.com', password: 'a-long-password' }); // after Ana confirms her e-mail and signs in: await sypnia.auth.signInWithPassword({ email: 'ana@example.com', password: 'a-long-password' }); await sypnia.from('notes').insert({ body: 'Buy flour' }); const { data } = await sypnia.from('notes').select('id, body').order('created_at', { ascending: false }); ``` **You should see:**`data` holds Ana's notes only. Another user signed in on another device gets their own, from the same table. Next: pick how to write the rest of your app ([Use any ORM](https://data.docs.sypnia.com/data/any-orm)), or let your agent manage the project through the [device flow](https://data.docs.sypnia.com/machines/device-flow-and-agents). --- ## Quickstart: self-host > Run the open-source engine with Docker next to a Postgres of yours, create a project and make your first request. Applies to: the Sypnia engine (open source, self-hosted). Source: https://data.docs.sypnia.com/start/quickstart-self-host/ For agents: Self-host quickstart: clone the repository, cp .env.example .env with SYPNIA_DATA_MASTER_KEY (openssl rand -base64 32) and POSTGRES_PASSWORD, docker compose up -d (Postgres 16, the engine, Mailpit at http://localhost:8025; the schema installs on first start), keys with docker compose exec data sypnia-data keys api-key --kind publishable|secret, first request with curl to /auth/v1/settings. You need Docker and ten minutes. The repository's compose file runs Postgres 16, the engine and Mailpit, which catches every e-mail. The same engine works against any Postgres 14+ you already run: point `DATABASE_URL` at it. #### 1. Get the compose file and its settings ```bash git clone https://github.com/sespinosav/sypnia-data && cd sypnia-data cp .env.example .env ``` In `.env`, set `SYPNIA_DATA_MASTER_KEY` to the output of `openssl rand -base64 32` (keep it: it encrypts the signing keys) and `POSTGRES_PASSWORD` to another random value. #### 2. Start it ```bash docker compose up -d curl http://localhost:8080/health ``` **You should see:**`{"status":"ok"}`. On its first start the engine installed its schema in the database. #### 3. Create the project's keys ```bash docker compose exec data sypnia-data keys api-key --kind publishable docker compose exec data sypnia-data keys api-key --kind secret ``` **You should see:**A publishable key `syp_pk_default_…` and a secret key `syp_sk_default_…`. The secret key is shown once. #### 4. Make your first request ```bash curl http://localhost:8080/auth/v1/settings -H "apikey: syp_pk_…" ``` **You should see:**JSON with `"email": true` among the providers and `"signup_open": true`. Sign-up e-mails appear in Mailpit at `http://localhost:8025`. From here the quickstart for Sypnia Cloud applies unchanged from step 3, with `http://localhost:8080` as the address. Going to production: [Self-hosting](https://data.docs.sypnia.com/self-hosting). --- ## Install with your coding agent > One command connects your app and its coding agent to a project: keys, the MCP server, the agent's skills, a machine client for your backend and typed tables. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://data.docs.sypnia.com/start/install-with-your-agent/ For agents: For coding agents: in the app's folder run `npx @sypnia/data init --project ` (add --server for the backend's machine client, --cases for Sypnorm + Sypnia Cases, or --orm none|sql|prisma|drizzle, --yes to never ask). It signs in with the device flow (the person approves a code in the browser; DPoP-bound session in ~/.config/sypnia, mode 600), writes SYPNIA_URL and SYPNIA_PUBLISHABLE_KEY to .env.local, adds the MCP server https://mcp.data.sypnia.com to .mcp.json / .cursor/mcp.json, installs the sypnia-data skill into .claude/skills plus an AGENTS.md section, records choices in sypnia.toml (top-level project + [data] table), and pulls types. With --cases it also installs @sypnia/cases in the app with its package manager (npm, pnpm, yarn or bun; --no-install skips it), installs the sypnia-cases skill and writes src/use-cases/ for @sypnia/cases/sypnorm; `npx @sypnia/cases map --upload --project ` sends the map to the project's Use cases; for a Cases project the agent adds the Cases MCP server https://mcp.cases.sypnia.com and creates and links it with the Cases MCP tools create_project, link_data_project, upload_map. Idempotent. Never ask the user to paste a secret key, password or token into the conversation. Everything in Sypnia Data can be done without a screen, so your coding agent can set up and run your backend. One command connects the app in the current folder, and the agent working on it, to your project. The console shows the same steps, ready to copy, on every project's home («Connect your agent»). ### Paste this into your agent ```text Connect this app to my Sypnia Data project (). 1. In the app's folder run: npx @sypnia/data init --project If the app has a backend, add --server. If we will work use case first (Sypnorm and Sypnia Cases), add --cases; otherwise it asks which ORM, if any. It shows a code: give it to me and I approve it in the browser. Never ask me for keys or passwords. 2. Use the MCP server https://mcp.data.sypnia.com (init added it to .mcp.json / .cursor/mcp.json). 3. Read .claude/skills/sypnia-data/SKILL.md (and sypnia-cases if it was installed) before touching the database. With Cases, create and link the Cases project with the Cases MCP tools. 4. Before writing code, propose the app's flows: who does what, which tables each one touches and how it can fail. Then create the tables with migrations and row-level security. ``` ### What `init` does ```bash npx @sypnia/data init --project [--server] [--cases | --no-cases | --orm none|sql|prisma|drizzle] [--agent claude,cursor,other|all] [--env-file .env.local] [--no-pull] [--no-install] [--yes] ``` 1. **Signs the machine in** with your Sypnia account through the [device flow](https://data.docs.sypnia.com/machines/device-flow-and-agents): it prints an address and a code, and you approve in the browser. The session is bound to a key that never leaves the machine (`~/.config/sypnia/`, mode 600), has `data:read data:write offline_access`, and lasts until you revoke it (Account → Agents and devices). 2. **Picks the project**: `--project `, the only one you have, or it asks. 3. **Writes the app's settings** to `.env.local` (`--env-file` to choose another): `SYPNIA_URL` and `SYPNIA_PUBLISHABLE_KEY`. A key that already has a different value is kept, never overwritten. 4. **With `--server`**, creates a [machine client](https://data.docs.sypnia.com/machines/client-credentials) for your backend: `private_key_jwt` with DPoP. The private key is written to `.sypnia/client-key.json` (mode 600, added to `.gitignore`) and only `SYPNIA_CLIENT_ID` goes to the env file. 5. **Connects the agent's MCP**: `.mcp.json` for Claude Code and `.cursor/mcp.json` for Cursor, with the [MCP server](https://data.docs.sypnia.com/machines/mcp) `https://mcp.data.sypnia.com`. The first call opens the browser to approve the client. 6. **Installs the agent's skills** into `.claude/skills/`: `sypnia-data` (the data layer: Data API, SQL, row-level security, transactions, machines, MCP, and notes for your ORM). It also adds a section to `AGENTS.md` for agents other than Claude. 7. **Asks whether the app will use Sypnorm and Sypnia Cases** (`--cases` or `--no-cases`). With Cases it installs `@sypnia/cases` in the app with its own package manager (npm, pnpm, yarn or bun; `--no-install` skips it, and an app that already has it is left alone), installs the `sypnia-cases` skill and writes `src/use-cases/`, one file per use case for `@sypnia/cases/sypnorm`. Once there is code, `npx @sypnia/cases map --upload --project ` sends the map to the project's [Use cases](https://data.docs.sypnia.com/console/auth-machines-and-use-cases#use-cases), and, once the project is linked to a Cases map, to that map as a draft proposal. To keep the map in a Cases project, your coding agent, signed in with the same Sypnia account, adds the Cases MCP server `https://mcp.cases.sypnia.com` and creates and links the project with the [Cases MCP tools](https://cases.docs.sypnia.com/tools/mcp/): `create_project`, `link_data_project`, then `upload_map` ([Linking Data and Cases](https://cases.docs.sypnia.com/links/data/)). Without Cases it asks which ORM, if any. 8. **Records the choices** in `sypnia.toml` at the root of the repository, the project's one configuration file for every Sypnia product: the project at the top, and the address, MCP, ORM and Cases in its `[data]` table. Nothing secret goes there, and `init` touches only `project` and `[data]`. `pull` and `migrate` read their defaults from it. 9. **Pulls the types** into `src/db/schema.gen.ts` (not with Prisma or Drizzle, which generate their own). Running it again changes only what is missing. With `--yes` it never asks: no Cases and no ORM unless you pass `--cases` or `--orm`. ### Which ORM Sypnia Data is only the data layer: use the ORM you want, or none. | Choice | How the app reaches the data | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | none (`--orm none`) | the Sypnia client over the Data API, with row-level security, on every project | | plain SQL (`--orm sql`) | a driver with a direct URL, or the [SQL endpoint](https://data.docs.sypnia.com/data/sql-and-migrations) from a server | | Prisma, Drizzle | a direct `postgres://` URL: a project with your own Postgres or a dedicated database. Managed shared projects have no direct URL. | | Sypnorm (`--cases`) | Sypnia's use-case ORM, part of [Sypnia Cases](https://cases.docs.sypnia.com/sypnorm/) (`@sypnia/cases/sypnorm`); it runs over the Data API, and a case other cases listen to runs in its area's service | ### Without `init` - **Only the session**: `npx @sypnia/data login`. With it, `pull` and `migrate` work on your Cloud projects through the Cloud API, with your organization role. - **Only the MCP server**: `claude mcp add --transport http sypnia https://mcp.data.sypnia.com`, or the same address in `.cursor/mcp.json`. - **The skills as a Claude Code plugin** for every project on your machine: `/plugin marketplace add sespinosav/sypnia-skills`, then `/plugin install sypnia@sypnia` (the repository is private until launch). > **Warning: Never paste a key into a chat** > > A secret key or a password pasted into a conversation can end up in logs and histories. `init` and the MCP sign-in exist so you never have to. If an agent asks you to paste a key, have it run `init` instead. ### What to ask for next - «Create a `bookings` table with row-level security so each customer sees only their bookings.» - «Add a server job that closes the month with the backend's machine client.» - «Tell me which tables have no policy.» The agent works through the same API you would, under the scopes you approved. Every change it makes is in the project's audit log. --- ## How Sypnia uses it > Every Sypnia account signs in with Sypnia Data, and Telemetry, the pilot, keeps its web app's database in it. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://data.docs.sypnia.com/start/how-sypnia-uses-it/ For agents: Dogfooding: the Sypnia account of every product is a user of the Sypnia Data project `sypnia`, served at auth.sypnia.com, signing in with e-mail only (password or e-mail link; no Google or GitHub on Sypnia's own project, while customer projects can turn them on); after any sign-in it sets the HttpOnly refresh cookie __Secure-sypnia-rt on .sypnia.com and each product app (data.app, telemetry.app, git, …) refreshes silently with X-Sypnia-CSRF, keeps the access token in memory and verifies it with the JWKS of auth.sypnia.com; sign-out with scope=global ends it everywhere; each product keeps its own members table and a roll-in use case. Sypnia's own sign-in e-mails leave from sypnia.com through Sypnia Mail (the sypnia_mail provider), like any customer project that chooses it. Coding agents sign in with npx @sypnia/data login (device flow, DPoP, a session that never expires until revoked) and reach every project through https://mcp.data.sypnia.com. Telemetry, the pilot that uses every Sypnia product, keeps its web app's database in a Sypnia Data project of Sypnia's organization and writes its flows as use cases with Sypnorm (@sypnia/cases), linked to its Cases map; its people sign in with their Sypnia account; its spans carry sypnia.case. Sypnia is built on Sypnia. Sypnia Data is where every Sypnia account lives, and Telemetry, the pilot of the suite, keeps its own data in it. ### Every Sypnia account signs in with Sypnia Data The Sypnia account you use in Telemetry, Git, the App and every other product is a user of one Sypnia Data project, `sypnia`, served at `auth.sypnia.com`. Nothing about it is special: it is the same engine, the same endpoints and the same rules this documentation describes. - **E-mail only.** Sypnia's console, and every product app, signs you in with your e-mail address: a password, or a link sent to that address. The `sypnia` project does not turn on sign-in with Google or GitHub; Sypnia Data supports both for your own projects ([SSO with Google and GitHub](https://data.docs.sypnia.com/auth/oauth-providers)). - **One session for the whole suite.** After any sign-in, `auth.sypnia.com` sets the refresh token in an `HttpOnly` cookie on `.sypnia.com`, with a harmless hint cookie next to it. Each product app (`data.app.sypnia.com`, `telemetry.app.sypnia.com`, Git…) refreshes silently with the CSRF header, keeps the access token in memory, and its API verifies it with the keys of `auth.sypnia.com`. Moving from one product to another needs no second sign-in, and signing out with `scope: 'global'` ends it everywhere. This is [cross-subdomain sessions](https://data.docs.sypnia.com/auth/users-and-your-data#several-apps-one-sign-in), on Sypnia's own domain. - **Each product keeps its own people.** Telemetry's members and roles live in Telemetry's tables, and the console's in its own, keyed by the user's id. The first time you open a product, it adds you with its own roll-in use case ([Users and your app's own data](https://data.docs.sypnia.com/auth/users-and-your-data#roll-in-the-first-visit)). - **Its e-mails go through Sypnia Mail.** Confirmations and magic links for Sypnia accounts leave from `sypnia.com` with the [`sypnia_mail` provider](https://data.docs.sypnia.com/auth/email-providers-and-templates#choosing-a-provider), the same one a customer project can choose, with the same templates. - **Agents sign in the standard way.** When someone on the team gives a coding agent access, the agent runs `npx @sypnia/data login`: the [device flow](https://data.docs.sypnia.com/machines/device-flow-and-agents), a DPoP-bound session that lasts until it is revoked, and nothing pasted into a chat. With that session it reaches every project of Sypnia's organizations through [`mcp.data.sypnia.com`](https://data.docs.sypnia.com/machines/mcp). ### Telemetry keeps its data in Sypnia Data Telemetry is the pilot of the suite: it uses every Sypnia product, from end to end. Its web app's database is a Sypnia Data project of Sypnia's organization. | What Telemetry does | With | | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Signs its people in | their Sypnia account, through `auth.sypnia.com` | | Keeps its organizations, members, projects and settings | ordinary tables in its Sypnia Data project, under [row-level security](https://data.docs.sypnia.com/data/row-level-security) | | Writes every flow as a use case («invite a member», «resolve a problem») | [Sypnorm](https://cases.docs.sypnia.com/sypnorm/), from `@sypnia/cases`, over the Data API with each person's token; a case another case listens to runs in its area's service, called with the person's session | | Keeps its use-case map | its [Sypnia Cases](https://cases.docs.sypnia.com/links/data/) project, linked to the Data project both ways | | Changes its schema | migrations in its repository, applied with `npx @sypnia/data migrate` | | Runs its background work | a [machine client](https://data.docs.sypnia.com/machines/client-credentials) with a key pair and DPoP, under the same policies | Every run of a Telemetry use case is a span with `sypnia.case`, watched by Telemetry itself, so the team sees a slow query or a failing flow the way a customer would. ### What it proves If sign-in breaks, a session ends too soon, or a policy lets someone see a row they should not, Sypnia's own team is the first to feel it, in production, every day. --- ## Auth > Sign-up and sign-in for the people who use your app, with sessions you control and e-mails sent through the provider you choose. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://data.docs.sypnia.com/auth/ For agents: Section index for user auth in Sypnia Data: e-mail and passwords (sign-up with or without password, confirmation, recovery, magic link and 6-digit code, reauthentication), sessions and tokens (EdDSA access JWTs, rotating refresh tokens with reuse detection, session policies including never), Google and GitHub (SSO) with PKCE, e-mail providers and templates, auth users vs your product's own users, and the built-in protections. Auth is the part of the engine that knows who people are. It lives at `/auth/v1` on your project's address and keeps everything in the `sypnia_auth` schema of your own database. A user in Sypnia Data holds **identity and sessions only**: an e-mail, a password hash, the providers they signed in with, and their devices. What a person may do in your app, their plan, their team, their role, lives in **your** tables, next to your data. [Users and your app's own data](https://data.docs.sypnia.com/auth/users-and-your-data) explains the pattern. - [E-mail and passwords](/auth/email-and-passwords/): Sign-up with or without a password, e-mail confirmation, sign-in, recovery, magic links and codes, and changing e-mail or password safely. - [Sessions and tokens](/auth/sessions-and-tokens/): Access tokens, refresh tokens, how long a session lives, and how to end one, including sessions that never expire. - [SSO with Google and GitHub](/auth/oauth-providers/): Single sign-on (SSO): let people sign in with Google or GitHub, with PKCE, and link those sign-ins to an existing account. - [E-mail providers and templates](/auth/email-providers-and-templates/): Which service sends your auth e-mails, how to connect your own or Sypnia Mail, and how to edit every e-mail in English, Spanish or any language. - [Users and your app's own data](/auth/users-and-your-data/): Why an auth user holds only identity and sessions, where your app keeps profiles and roles, and how several apps share one sign-in. - [Built-in protections](/auth/protections/): Rate limits, lockout, CAPTCHA, the audit log and the other defences every project has from the start. ### The API keeps a familiar shape The endpoints follow the shape of Supabase's auth server (GoTrue): `/auth/v1/signup`, `/auth/v1/token?grant_type=password`, `/auth/v1/verify`, `/auth/v1/user`. Code written for `supabase-js` auth moves to `@sypnia/data` with few changes. The full list is in [Auth endpoints](https://data.docs.sypnia.com/api/auth-endpoints). --- ## E-mail and passwords > Sign-up with or without a password, e-mail confirmation, sign-in, recovery, magic links and codes, and changing e-mail or password safely. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://data.docs.sypnia.com/auth/email-and-passwords/ For agents: E-mail auth flows: signUp (password optional: 'e-mail first' sends a link that leads to create-your-password), confirmation required by default, signInWithPassword, signInWithOtp (one e-mail with a magic link and a 6-digit code), verifyOtp, resetPasswordForEmail (always 200), updateUser for password (recent sign-in or reauthentication nonce) and e-mail (confirmed on both addresses). Password policy: min length 10, optional character rules, breached-password check. Passwords hashed with argon2id. ### Sign-up Two ways, both with `POST /auth/v1/signup`: | | You send | What happens | | ----------------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | **E-mail and password** | `{ email, password }` | The user exists, unconfirmed. The e-mail asks to confirm. | | **E-mail first** | `{ email }` | The e-mail asks to confirm **and create a password**. The link opens your «create your password» screen with a session ready to set it. | ```ts await sypnia.auth.signUp({ email: 'ana@example.com', options: { data: { name: 'Ana' }, emailRedirectTo: 'https://myapp.com/welcome' } }); ``` `options.data` goes to `user_metadata`. `emailRedirectTo` must match one of the project's **redirect URLs**: exact addresses or patterns such as `https://*.myapp.com/**`. Confirmation is required by default (`require_email_confirmation`). Turn it off only for internal tools: an unconfirmed address can belong to someone else. ### Confirmation links and codes Every auth e-mail carries a **link** and a **6-digit code**, so a person can confirm on another device by typing the code. - Links and codes work **once**, for **one hour** (configurable from 5 minutes to 24 hours), and are stored only as hashes. - A code allows 5 attempts; then a new e-mail is needed. - `GET /auth/v1/verify?token_hash=…&type=signup&redirect_to=…` confirms and redirects to your app with the session in the address fragment (`#access_token=…&refresh_token=…`). `@sypnia/data` reads it and clears it from the address bar. ### Sign-in ```ts await sypnia.auth.signInWithPassword({ email, password }); // POST /auth/v1/token?grant_type=password await sypnia.auth.signInWithOtp({ email }); // POST /auth/v1/otp: link + code, no password await sypnia.auth.verifyOtp({ email, token: '483920', type: 'email' }); ``` A wrong password and an unknown e-mail get the same answer, `invalid_credentials`, so nobody can test which e-mails have accounts. ### Forgotten password `resetPasswordForEmail(email, { redirectTo })` always answers 200. If the account exists, the e-mail carries a recovery link; it signs the person in with a short **recovery session** whose only use is `updateUser({ password })`. ### Changing password or e-mail - **Password**: allowed if the person signed in less than 10 minutes ago; otherwise call `reauthenticate()` (a code by e-mail) and pass it as `nonce`. Every other session of the user is ended, and a «your password changed» e-mail goes out. - **E-mail**: a confirmation goes to **both** the old and the new address; the change applies when both are confirmed. A user without an e-mail confirms only the new one. ### Password policy | Setting | Default | | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | Minimum length | 10 (8 to 128) | | Required characters | none; optional lower, upper, digit, symbol | | Breached-password check | on: the first 5 characters of the SHA-1 hash are checked against Have I Been Pwned (k-anonymity: the password never leaves the engine) | Passwords are hashed with **argon2id** (19 MiB memory, 2 iterations). --- ## Sessions and tokens > Access tokens, refresh tokens, how long a session lives, and how to end one, including sessions that never expire. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://data.docs.sypnia.com/auth/sessions-and-tokens/ For agents: Sessions in Sypnia Data: access token = EdDSA (Ed25519) JWT, default TTL 3600 s (300–86400), claims iss/sub/aud/role/exp/iat/jti/session_id/aal/amr/email/app_metadata/user_metadata/client_id/scope/cnf.jkt; refresh token syp_rt_… opaque, stored as SHA-256, rotated on every use, reuse after the 10 s window revokes the whole session. Session policy per project: access_token_ttl, session_lifetime (or never), inactivity_timeout (or never), single_session. Logout scopes local/others/global; users list and revoke their sessions; JWKS at /.well-known/jwks.json with key rotation. A signed-in person or machine holds two things. | | What it is | Lifetime | Where it lives | | ----------------- | ------------------------------------------------------------- | ---------------------- | ------------------------------------- | | **Access token** | A JWT signed by the project, sent on every request | 1 hour by default | In memory (the SDK) | | **Refresh token** | `syp_rt_…`, a long random string that gets a new access token | As long as the session | Secure storage, or an HttpOnly cookie | ### The access token Signed with **EdDSA (Ed25519)**. Your own servers can verify it without calling the engine, with the public keys at `/.well-known/jwks.json`. ```json { "iss": "https://.data.sypnia.com/auth/v1", "sub": "7c0e…", "aud": "authenticated", "role": "authenticated", "exp": 1795000000, "iat": 1794996400, "jti": "…", "session_id": "b1f2…", "aal": "aal1", "amr": [{ "method": "password", "timestamp": 1794996400 }], "email": "ana@example.com", "app_metadata": { "provider": "email" }, "user_metadata": { "name": "Ana" } } ``` `role` is the database role the Data API uses. `user_metadata` is left out when it is larger than 2 kB, to keep tokens small; read it with `getUser()`. ### The refresh token rotates Every use returns a **new** refresh token and retires the old one. If a retired token comes back after the **reuse window** (10 seconds, for two tabs refreshing at once), the engine assumes it was stolen: it ends the whole session and writes `refresh_token_reuse` to the audit log. The person signs in again; the thief's copy is dead. ### How long a session lives Each project has a **session policy**. Every value can be changed in the console or with the API, and each limit can be **never**: | Setting | Default | Values | | ------------------------ | ------- | ------------------------------------------------------ | | `access_token_ttl` | 3 600 s | 300 to 86 400 s | | `session_lifetime` | never | seconds (at least 60), or never | | `inactivity_timeout` | never | seconds since the last refresh (at least 60), or never | | `single_session` | off | on: a new sign-in ends the user's other sessions | | `refresh_reuse_interval` | 10 s | 0 to 60 s | A value outside its range is refused with `400 invalid_session_policy`, and the message names the field and its range; the same goes for a client's own policy. A new policy applies to sessions that start after it; the settings are cached for up to a minute. Machines signed in with the [device flow](https://data.docs.sypnia.com/machines/device-flow-and-agents) follow their **client's** policy instead, so an agent can keep a session that never expires while your users' sessions end after 30 days. ### Ending sessions - `signOut()` ends this device; `signOut({ scope: 'others' })` the others; `signOut({ scope: 'global' })` all. - A person lists their devices with `sessions.list()` and ends any of them. - An admin (secret key or the console) can end every session of a user, ban a user until a date, or delete them. - Changing a password ends every other session. ### Signing keys Each project has its own Ed25519 keys, encrypted at rest (with AWS KMS in Sypnia Cloud, or with your master key when you self-host). To rotate: a new key is published in the JWKS first, used for signing 24 hours later, and the old one stays published until every token it signed has expired. No one is signed out. --- ## SSO with Google and GitHub > Single sign-on (SSO): let people sign in with Google or GitHub, with PKCE, and link those sign-ins to an existing account. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://data.docs.sypnia.com/auth/oauth-providers/ For agents: Provider sign-in: Google (OpenID Connect) and GitHub (OAuth 2.0); signInWithOAuth({provider, redirectTo}) → GET /auth/v1/authorize with PKCE S256 → provider → /auth/v1/callback → app gets ?code= → exchangeCodeForSession (grant_type=pkce). Configure client id and secret per project; callback URL https://.data.sypnia.com/auth/v1/callback. Identities stored in sypnia_auth.identities; linking by verified e-mail only. **SSO (single sign-on)**: people sign in with an account they already have, so your project does not have to send e-mails at all: the provider has already checked the person. The providers are **Google** (OpenID Connect) and **GitHub** (OAuth 2.0). ### Set it up 1. Create an OAuth app at the provider: - Google: Google Cloud console → APIs & Services → Credentials → OAuth client ID (Web application). - GitHub: Settings → Developer settings → OAuth Apps → New. 2. As the **callback** (redirect) URL, use `https://.data.sypnia.com/auth/v1/callback` (self-hosted: your engine's address). 3. In the console → Auth → Providers (or `PATCH /auth/v1/admin/settings`), paste the client id and secret. The secret is stored encrypted. ### The flow (PKCE) ```ts await sypnia.auth.signInWithOAuth({ provider: 'google', options: { redirectTo: 'https://myapp.com/auth/done' } }); // on /auth/done: await sypnia.auth.exchangeCodeForSession(new URL(location.href).searchParams.get('code')!); ``` 1. The SDK makes a random **code verifier**, keeps it, and opens `/auth/v1/authorize?provider=google&code_challenge=…&code_challenge_method=S256`. 2. The engine sends the person to Google, with its own `state` and `nonce`. 3. Google returns to `/auth/v1/callback`; the engine checks `state`, exchanges the code with Google and reads the verified e-mail. 4. The engine redirects to your `redirectTo` with a one-time `?code=`. 5. Your app exchanges that code **and the verifier** for a session. Someone who steals the code cannot use it without the verifier. ### Identities and linking A sign-in with a provider is an **identity** (`sypnia_auth.identities`). One user can have several: e-mail, Google and GitHub. - If the provider gives a **verified** e-mail that matches an existing user, the identity is linked to that user. - An **unverified** e-mail is never linked; a new user is created instead. - A signed-in user can link another provider with `linkIdentity({ provider })` and unlink it, as long as one way to sign in remains. --- ## E-mail providers and templates > Which service sends your auth e-mails, how to connect your own or Sypnia Mail, and how to edit every e-mail in English, Spanish or any language. Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service). Source: https://data.docs.sypnia.com/auth/email-providers-and-templates/ For agents: Auth e-mail delivery per project: Sypnia sends no e-mail of its own on behalf of projects (no default sender in Sypnia Cloud). Providers: smtp, resend, postmark, ses (your own credentials), sypnia_mail (Sypnia Mail, Sypnia Cloud: from on a domain verified in Sypnia Mail, paid with the organization's credits), none (provider sign-in only); self-hosted engines also have sypnia (the engine's own sender, SYPNIA_DATA_MAIL, allowed per project with SYPNIA_DATA_MAIL_DEFAULT_REFS). A project starts without a provider: mail_state provider_required, /auth/v1/settings email_ready false, and sign-up with confirmation, magic link, OTP, recovery, invite, e-mail change and reauthentication answer 409 email_provider_required before anything is written; Google/GitHub and password sign-up without confirmation work. mail_state: ready, provider_required, off, misconfigured. Errors on PATCH /auth/v1/admin/settings: 400 invalid_mail_provider, 422 provider_not_available (sypnia in Cloud), 400 mail_not_configured (no from). A failed send answers 202 email_queued_retry and is retried 3 times over about 10 minutes; bounced or complained addresses are suppressed. Templates per type (confirmation, invite, magic_link, recovery, email_change, reauthentication, password_changed, new_device) with subject/HTML/text and variables {{ .ConfirmationURL }}, {{ .Token }}, {{ .SiteURL }}, {{ .Email }}, {{ .ProjectName }}, {{ .Data.key }}; English and Spanish defaults chosen by user_metadata.locale; 400 invalid_template on save; preview and test send in the console. Auth sends e-mails: confirm your address, sign in with this link, reset your password. Each project chooses **who sends them**. ### Providers | Provider | `provider` | Where | Use it for | | --------------------------- | ------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **SMTP** | `smtp` | engine and Cloud | Any mail service: host, port, user, password, TLS. | | **Resend** | `resend` | engine and Cloud | An API key and a verified domain. | | **Postmark** | `postmark` | engine and Cloud | A server token and a sender signature. | | **Amazon SES (yours)** | `ses` | engine and Cloud | Your own access key, region and verified sender. | | **Sypnia Mail** | `sypnia_mail` | Sypnia Cloud | [Sypnia Mail](https://mail.docs.sypnia.com), Sypnia's sending product: your domain is verified there, and sending counts like any Sypnia Mail e-mail: 10 free a month, then your organization's credits. | | **The engine's own sender** | `sypnia` | a self-hosted engine | The sender the operator configured for the whole engine ([below](#self-hosting)). | | **None** | `none` | engine and Cloud | Projects that use only Google or GitHub. No e-mail is sent. | **Sypnia does not send e-mail of its own on behalf of your project.** A new project starts **without a provider**: sign-in with Google or GitHub works at once, and the e-mail flows turn on when you choose a provider, so every e-mail comes from your own domain. Inside Sypnia Cloud, Sypnia Mail is the shortest path: when the domain is in Sypnia Domains, Sypnia Mail writes its records for you. Setting up Amazon SES yourself needs a verified domain and production access from AWS, which takes a request and a day or two; Resend and Postmark are faster to start. Credentials are stored encrypted and never shown again. ### Without a provider Until you choose one, every flow that has to send an e-mail is refused **before anything is written or looked up**, so the answer never tells whether an address has an account: | Flow | Endpoint | | ------------------------------------------------------------------------- | --------------------------------------------------- | | sign-up that needs a confirmation (or «e-mail first», without a password) | `POST /auth/v1/signup` | | magic link and 6-digit code | `POST /auth/v1/otp` (and `POST /auth/v1/magiclink`) | | password recovery | `POST /auth/v1/recover` | | invite | `POST /auth/v1/admin/invite` | | e-mail change | `PUT /auth/v1/user` with `email` | | reauthentication | `POST /auth/v1/reauthenticate` | They answer `409`: ```json { "error": { "code": "email_provider_required", "message": "This project has no e-mail provider. Set one in Auth → E-mail (SMTP, Resend, Postmark or your own SES), or sign people in with Google or GitHub." } } ``` What keeps working: Google and GitHub (SSO), and a sign-up with a password when **Require e-mail confirmation** is off. Two places tell you the state: - `GET /auth/v1/settings` (public) has `email_ready`: `false` until a provider can send, so your sign-in form can hide the e-mail options. - `GET /auth/v1/admin/settings` has `mail_state` and `mail_providers`, the providers this project may choose (in Sypnia Cloud: `smtp`, `resend`, `postmark`, `ses`, `sypnia_mail`, `none`). The console's **Auth → E-mail sender** shows a warning with **Configure a provider** and **Enable Google or GitHub**. | `mail_state` | Means | | ------------------- | ------------------------------------------------------------------------------------------ | | `ready` | the provider is set and can send | | `provider_required` | no provider yet | | `off` | the provider is **None** | | `misconfigured` | a provider is chosen but it cannot send: `from` is missing, or a credential cannot be read | ### Choosing a provider ```bash curl -X PATCH https://.data.sypnia.com/auth/v1/admin/settings \ -H "apikey: $SYPNIA_SECRET_KEY" -H "content-type: application/json" \ -d '{"mail": {"provider": "smtp", "from": "La Espiga ", "smtp_url": "smtps://user:password@smtp.example.com:465"}}' ``` | `provider` | Also send | | ------------- | ------------------------------------------------------------------------------------------------------------------- | | `smtp` | `from`, `smtp_url` (`smtps://user:password@host:465`, or `smtp://user:password@host:587?tls=required` for STARTTLS) | | `resend` | `from`, `api_key` | | `postmark` | `from`, `api_key` (the server token) | | `ses` | `from`, `ses_region`, `ses_access_key_id`, `ses_secret_access_key` | | `sypnia_mail` | `from`: an address on a domain verified in Sypnia Mail | | `none` | nothing | With Sypnia Mail you give only the sender: ```bash curl -X PATCH https://.data.sypnia.com/auth/v1/admin/settings \ -H "apikey: $SYPNIA_SECRET_KEY" -H "content-type: application/json" \ -d '{"mail": {"provider": "sypnia_mail", "from": "La Espiga "}}' ``` Sypnia Mail sends from your domain, with its reputation, its suppression list and its delivery events, and each e-mail counts like any other Sypnia Mail e-mail: the 10 free e-mails a month first, then your organization's credits. You see them in Sypnia Mail next to the rest of your e-mail. Credentials (`smtp_url`, `api_key`, `ses_secret_access_key`) are sealed when saved and come back as `"[redacted]"`. Sending `"[redacted]"` back keeps the stored value. | Error | When | | ---------------------------- | -------------------------------------------------------------------------------------------------------------- | | `400 invalid_mail_provider` | `provider` is not one of the values above | | `422 provider_not_available` | `sypnia` in a project the engine does not allow to use its own sender (every customer project in Sypnia Cloud) | | `400 mail_not_configured` | an e-mail is sent while the provider has no `from` | | `400 unknown_setting` | a key that is not a setting | #### When sending fails - **The provider is down.** The flow still succeeds for the person: the one-time token is kept, and the answer is `202` with `{"status": "email_queued_retry"}`. The e-mail is retried 3 times over about 10 minutes from a row in `sypnia_auth.email_outbox`. - **An address bounces or complains.** It is suppressed for auth e-mails (`sypnia_auth.email_suppressions`), and later e-mails to it are skipped. #### Self-hosting A self-hosted engine has one sender of its own (`SYPNIA_DATA_MAIL`, Mailpit in the Docker quickstart), chosen with `"provider": "sypnia"`, and by default **every project** may use it: nothing above applies unless you limit it. `SYPNIA_DATA_MAIL_DEFAULT_REFS` lists the projects allowed to use it (comma-separated; unset or `*` means all), and `SYPNIA_DATA_MAIL_DEFAULT_HOURLY_CAP` can cap how many e-mails per hour each of them sends through it. Sypnia Cloud allows it only for its own project. See [Configuration](https://data.docs.sypnia.com/self-hosting/configuration). ### Templates | Template | Sent when | | ------------------ | ---------------------------------------------------------------------------------------------------------------- | | `confirmation` | someone signs up | | `invite` | an admin invites someone | | `magic_link` | someone asks for a sign-in link or code | | `recovery` | someone forgot their password | | `email_change` | someone changes their e-mail (to both addresses) | | `reauthentication` | a sensitive change needs a fresh code | | `password_changed` | a password was changed | | `new_device` | a password sign-in comes from a network the person has not signed in from before, and they already had a session | Each has a subject, an HTML body and a text body, with these variables: ```text {{ .ConfirmationURL }} the link to open {{ .Token }} the 6-digit code {{ .SiteURL }} your app's address (site_url) {{ .Email }} the person's e-mail {{ .ProjectName }} the project's name (project_name) {{ .Data.name }} any key of user_metadata ``` The engine ships every template in English and Spanish and picks one by `user_metadata.locale`. You override any of them per language in `settings.templates.