Choose your stack
For: a developer who starts with authtempo and must choose where it runs.
What it does: this page compares the five stacks and sends you to the tutorial of one.
Before you start
Section titled “Before you start”- Know where your API runs: Cloudflare Workers, Node, or Bun. Runtimes and compatibility flags lists what each needs.
- Know which database your app has, or will have. Schema and migrations covers D1 and Postgres.
- Find your runtime and your database in the table.
- Open the tutorial of that row, and do every step.
- Then do Your first sign-in from a web app. The MCP server tutorial ends with a sign-in through an MCP client, so it needs no web app.
| Stack | Storage adapter | Node.js compatibility | Example app | Tutorial |
|---|---|---|---|---|
| Workers on D1 | @authtempo/adapter-d1 |
Off: no_nodejs_compat |
examples/worker-d1 |
Workers on D1 |
| Workers on Postgres | @authtempo/adapter-postgres through Hyperdrive |
On: nodejs_compat |
examples/worker-postgres |
Workers on Postgres through Hyperdrive |
| Node | @authtempo/adapter-postgres |
Not a Workers setting | examples/node |
Node |
| Bun | @authtempo/adapter-postgres |
Not a Workers setting | examples/node, run by Bun |
Bun |
| An MCP server on Workers with D1 | @authtempo/adapter-d1 |
Off: no_nodejs_compat |
examples/mcp-server |
An MCP server on Workers with D1 |
The packages today
Section titled “The packages today”The @authtempo packages are on npm. Add the CLI to your app with pnpm add -D @authtempo/cli, and run each command as pnpm exec authtempo ….
| Package | Role |
|---|---|
@authtempo/core |
The engine. createAuth(config) answers handle, session, caller, and api. |
@authtempo/adapter-d1 |
The storage on Cloudflare D1, with its migrations and an owned limiter. |
@authtempo/adapter-postgres |
The storage on Postgres through postgres.js, with its migrations and an owned limiter. |
@authtempo/adapter-sqlite |
The storage on SQLite for Node and Bun, and on remote libSQL, with its migrations and an owned limiter. Run authtempo on SQLite tells how. |
@authtempo/adapter-mysql |
The storage on MySQL 8.4 and later through mysql2, with its migrations and an owned limiter. Run authtempo on MySQL tells how. |
@authtempo/client |
The app side: createClient calls the routes and answers typed results. It runs in a browser, in Expo, and in Electron. |
@authtempo/handoff |
The sign-in of a native or desktop app through the system browser. |
@authtempo/compat-better-auth |
Runs an app written for Better Auth 1.7 on authtempo, on its own tables. |
@authtempo/legacy-hashes |
Verifies the password hashes of other systems and rewrites them as PBKDF2. |
@authtempo/import |
The import engine, which moves users from another provider. The command authtempo import runs it. |
@authtempo/cli |
The authtempo command: init, migrate, import, check, and keys rotate. The CLI lists each. |
What each stack costs
Section titled “What each stack costs”- A password hash needs more CPU than Workers Free gives one request. A Worker with passwords needs Workers Paid.
- D1 has no interactive transaction. A transaction on D1 is not isolated from other requests. The race rules tell what that means.
- On Workers the Postgres client has one connection for each request. Read The one-connection rule before you add a hook.
- The MCP server stack signs in by magic link and holds no password, so it runs on Workers Free.
- Off Workers, the server must give core the client IP. The Node example sets a header from the socket, and core reads only that header.