postboi
v0.54.3
Published
Postboi is an email provider and TypeScript SDK. Send email with one token and no DNS setup, plus SMS, WhatsApp, push and chat from the same API. You can also use your own provider (Resend, SES, Postmark and more) if you want to.
Maintainers
Readme
Email for your app, set up with one command
Postboi is an email provider, and postboi is its TypeScript SDK. Run
npx postboi init and mail() sends: no DNS, no card, no other provider to sign up for.
Receiving, lists, webhooks and forms are already in the box.
3,000 emails a month are free, for good. After that it's £9 for 40,000 or £25 for 100,000, which is less than Resend charges for the same volume (Postboi or Resend?).
Already have a provider? mail() works with Resend, SES, Postmark and 40-odd others too, so
switching is a line of config. You don't need any of them to use Postboi. And when you want
more than email, the same API sends SMS, WhatsApp, push and chat.
📖 Docs · Pricing · Postboi compared · Dashboard
Quick start
bunx postboi initPick Postboi, sign in in the browser, and you're done. The CLI writes one secret:
# .env
POSTBOI_TOKEN=…import { mail } from "postboi"
await mail({ to: "[email protected]", subject: "Hi", body: "<p>Hello</p>" })Mail goes out from [email protected] until you verify your own domain. Everything
that isn't a secret (defaults, hooks, the captcha key) goes in a committed
postboi.config.ts, and from is typed to the addresses
your account can send from.
No one at the keyboard? bunx postboi init --agent sets up a project with no prompts and no
sign-in. Sends stay sandboxed until someone claims it with one click.
More on that.
What you get
- Sending, domains, lists and broadcasts, contacts, suppressions and a message log, all on the one token. The Postboi provider
- FormData to email. Hand
mail()aFormDataand it becomes a tidy HTML table, with attachments and grouped fields - Hosted forms for sites with no backend, and spam protection (honeypot plus an invisible captcha)
- A dev inbox at
/__postboi, so mail sent in development never reaches a real person - Webhooks for delivered, opened, clicked and bounced, in one format whichever provider sent it
- Scheduling, tracking and one-click unsubscribe. Scheduling · Tracking
- Email testing.
analyze()checks client support, Gmail clipping, alt text and links, offline, in any test suite - Any HTML for the body, or Maizzle templates
- One error type,
PostboiError, whichever provider failed
Bring your own provider
Pick Bring your own provider in postboi init instead. Your code stays the same:
// postboi.config.ts
import { config } from "postboi"
export default config({ provider: "resend", default: { from: "[email protected]" } })# .env
RESEND_API_KEY=re_xxxxxxxxSee all providers.
SvelteKit
A contact form action is one line:
// +page.server.ts
import { mail } from "postboi/kit"
export const actions = { default: mail }Or use remote functions with postboi/remote and skip
the server file. Postboi also has guides for Next.js,
Astro, Nuxt,
Remix, Hono,
Express and
Cloudflare Workers.
Beyond email
Run bunx postboi init --sms (or --whatsapp, --push, --chat) and call the function:
import { sms, whatsapp, push, slack, send } from "postboi"
await sms({ to: "+447788223344", message: "Your code is 4291" })
await whatsapp({ to: "+447788223344", template: "order_shipped", variables: { name: "Ada" } })
await push({ to: subscription, title: "Order shipped", message: "On its way" })
await slack({ message: "Deploy finished" })
// or try the cheapest channel first and stop when one works
await send({
to: { push: subscription, sms: "+447788223344" },
channels: "cheapest",
message: "Your code is 4291",
})In development, texts and WhatsApp messages are logged, not sent.
SMS · WhatsApp ·
Push · Chat ·
send()
For AI agents
bunx postboi skillinstalls a skill that teaches the whole library, at.claude/skills/postboi/and.agents/skills/postboi/. It also ships in the package atnode_modules/postboi/skills/postboi/SKILL.md.- The docs pages render client-side, so fetch plain Markdown from
https://docs.postboi.app/raw/<slug>, or everything at once from/llms-full.txt.
Development
bun install
bun run dev # the docs site
bun run check # types
bun run lint
bun run test
bun run build # the packagePRs are welcome, new providers especially. Match the code style (snake_case, no
semicolons), add tests, and run check and lint before pushing. Releases are covered in
RELEASING.md.
