caelum0x 830e75702a docs(mail): match the live server — plans from /billing/plans, SDK and SMTP marked not yet live, no open-source claim
- limits-pricing, index, migrate-from-resend: Free 3,000/mo, Pro $20 then
  $0.80/1k, Scale $90 for 150,000 then $0.60/1k (the live GET /billing/plans);
  pay-as-you-go, auth-email allowance and Mail Studio grandfathering lines
  removed (not implemented).
- sdk-typescript + quickstart: @scribase/mail is not on npm, marked {soon}.
- test-mode: SMTP submission marked {soon}; "open source (MIT)" and
  "your own install" removed (the source is not published); local dev =
  sk_test_ key against the hosted API.
- build.mjs default base URL -> https://scribase.com/mail/docs/ (published
  there from the scribase www repo, commit 77f1469).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 14:36:25 +03:00

3.9 KiB

title, nav, description
title nav description
Quickstart Quickstart Send your first email with Scribase Mail in two minutes using curl or the TypeScript SDK. Resend-compatible API, built-in magic-link login, one bill with your Scribase database and auth.

Scribase Mail sends and receives email for your app. Add your domain, publish three DNS records, and send sign-in links, codes, receipts and alerts with one HTTP call. The API matches Resend's, so the resend SDK you already have works by changing the base URL. Sign-in emails (magic links and one-time codes with a verifiable JWT) are built in, and the bill is the same Scribase bill as your database and auth.

Who it is for: founders and small teams already running on Supabase, Neon or Resend who want one account for data, auth and email.

1. Get an API key

Sign in at mail.scribase.com (magic link, no password, no card), open API keys, create a key. Keys start with sk_ and are shown once. A full_access key can manage domains, keys and webhooks; a sending_access key can only send (optionally from one domain). Use sending keys in app servers.

export SCRIBASE_MAIL_API_KEY=sk_...

2. Add your domain

curl -X POST https://mail-api.scribase.com/domains \
  -H "Authorization: Bearer $SCRIBASE_MAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "yourapp.com" }'

The answer lists the DNS records to publish (records[]: DKIM TXT, SPF TXT on the send sub-domain, DMARC TXT). Add them at your DNS provider, then:

curl -X POST https://mail-api.scribase.com/domains/$DOMAIN_ID/verify \
  -H "Authorization: Bearer $SCRIBASE_MAIL_API_KEY"

GET /domains/$DOMAIN_ID shows status: "verified" once DKIM and SPF resolve. Details on each record: Domains and DNS.

3. Send

curl

curl -X POST https://mail-api.scribase.com/emails \
  -H "Authorization: Bearer $SCRIBASE_MAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Your App <hello@yourapp.com>",
    "to": ["jane@example.com"],
    "subject": "Welcome",
    "html": "<p>Thanks for signing up.</p>",
    "text": "Thanks for signing up."
  }'
{ "id": "7af8001f-54d6-4607-b951-ee1cc2ad60d5" }

TypeScript {soon}

The @scribase/mail package is not on npm yet. Until it is, use the resend package with a new base URL (next section) or plain fetch.

npm install @scribase/mail   # not published yet
import { ScribaseMail } from "@scribase/mail";

const mail = new ScribaseMail(process.env.SCRIBASE_MAIL_API_KEY);

const { data, error } = await mail.emails.send({
  from: "Your App <hello@yourapp.com>",
  to: ["jane@example.com"],
  subject: "Welcome",
  html: "<p>Thanks for signing up.</p>",
  text: "Thanks for signing up.",
});

if (error) throw new Error(`${error.name}: ${error.message}`);
console.log(data.id);

Zero dependencies; runs on Node 18+, Bun, Deno and Cloudflare Workers. Every method returns { data, error } like the Resend SDK, so switching is an import change. Full surface: TypeScript SDK.

Already on the resend package?

const resend = new Resend(process.env.SCRIBASE_MAIL_API_KEY, {
  baseUrl: "https://mail-api.scribase.com",
});

or set RESEND_BASE_URL=https://mail-api.scribase.com. See Migrate from Resend.

4. Check what happened

curl https://mail-api.scribase.com/emails/$EMAIL_ID \
  -H "Authorization: Bearer $SCRIBASE_MAIL_API_KEY"

last_event moves through queued, sent, delivered (or bounced, complained, failed). To be told instead of asking, add a webhook.

Next