Access is invite-only during beta. Once invited, create a key to personalize these examples. Production sending requires a separate review.

Send emails with Inngest

Install the Inngest adapter and call sendEmail inside step.run.

sendEmail wraps cluster send in step.run. Inngest retries the step. A 429 with error throttled is the hourly throttle or 24-hour cap. The adapter becomes RetryAfterError and waits before retrying. Do not retry that send immediately. Permanent errors become NonRetriableError.

clusterId is required. This client posts to POST /api/v1/teams/:teamId/clusters/:clusterId/sends. Pass idempotencyKey from event.id so a replayed step does not double-send.

send.ts
1 import { Inngest } from "inngest"
2 import { sendEmail } from "@postshiba/inngest"
3
4 const inngest = new Inngest({ id: "app" })
5
6 export const sendWelcome = inngest.createFunction(
7 { id: "send-welcome" },
8 { event: "app/user.created" },
9 async ({ event, step }) => {
10 return await sendEmail(
11 step,
12 {
13 apiKey: "YOUR_API_KEY",
14 teamId: "KjkAJW",
15 clusterId: "NmQpXr",
16 },
17 {
18 from: "hello@mail.example.com",
19 to: [event.data.email],
20 subject: "Welcome",
21 text: "Glad you are here.",
22 idempotencyKey: event.id,
23 },
24 )
25 },
26 )

Installation

install.sh
1 npm install github:postshiba/postshiba-inngest inngest

Node 18 or later. Open pull requests on postshiba/sdks.

Webhooks

http.ts
1 import { handleWebhook } from "@postshiba/inngest"
2 import { inngest } from "./inngest"
3
4 export async function POST(req: Request) {
5 return handleWebhook(req, {
6 secret: process.env.POSTSHIBA_WEBHOOK_SECRET!,
7 inngest,
8 })
9 }

HMAC-SHA256 of {timestamp}.{rawBody} against X-Capsule-Signature with a sha256= prefix. X-Capsule-Timestamp must be within 300 seconds. Each event is sent as postshiba/email.event.

Errors and throttling

Failed responses throw PostShibaHttpError with status, code, and retryable. sendEmail maps those onto Inngest errors before they leave the step.

A 429 with error throttled means the cluster hit its hourly throttle or its 24-hour cap. This adapter waits before retrying. Do not retry that send immediately.

See Errors.

About

PostShiba is the email platform that powers Bento behind the scenes. You can build your own products, like Bento, on top of it.

© 2026 PostShiba by Backpack Internet Pty. Ltd. All rights reserved.

The same policies that govern Bento are applied to PostShiba Privacy | Terms | Security