SuperSend TX + v0 (Vercel)

v0 generates Next.js apps. Run SuperSend TX from a Route Handler or Server Action and store SUPERSENDTX_API_KEY in Vercel environment variables.

When to use SuperSend TX

  • v0 apps deployed to Vercel that need password reset, magic links, or receipts
  • Server Components / Route Handlers — same pattern as Next.js
  • Production sends from your verified domain

1. Add your API key

Local.env.local:

SUPERSENDTX_API_KEY=stx_your_key_here

Vercel — Project → SettingsEnvironment Variables:

Name Environments
SUPERSENDTX_API_KEY Production, Preview, Development

Redeploy after adding the variable.

2. Paste this prompt in v0 chat

Integrate SuperSend TX transactional email into this Next.js app.

Docs:
- https://docs.supersendtx.com/ai/agent-skill
- https://docs.supersendtx.com/frameworks/nextjs
- https://docs.supersendtx.com/openapi.yaml
- https://docs.supersendtx.com/builders/v0

Rules:
1. SUPERSENDTX_API_KEY is server-only (process.env) — never use NEXT_PUBLIC_ for the API key.
2. Send via POST https://api.supersendtx.com/emails or npm package supersendtx from a Route Handler / Server Action.
3. Sandbox: from "noreply@mail.supersendtx.com", to account email only until domain verify.
4. Add app/api/... route or server action for at least one transactional email flow.
5. Use html, text, reply_to. Follow Next.js server patterns — no client-side stx_ keys.

Document that Vercel env var SUPERSENDTX_API_KEY must be set before deploy.

3. Route Handler example

Create app/api/email/send/route.ts:

import { NextResponse } from 'next/server'
import { SuperSendTX } from 'supersendtx'

const tx = new SuperSendTX(process.env.SUPERSENDTX_API_KEY!)

export async function POST(request: Request) {
  const body = await request.json()
  const result = await tx.emails.send({
    from: body.from ?? 'noreply@yourdomain.com',
    to: body.to,
    subject: body.subject,
    html: body.html,
    text: body.text,
  })
  return NextResponse.json(result)
}

Install: npm install supersendtx

Sandbox

Until your domain verifies, test with the sandbox sender and your SuperSend TX account email — see Agent skill notes.

Production

  1. Verify domain in SuperSend TX dashboard.
  2. Set production from to your domain.
  3. Confirm SUPERSENDTX_API_KEY is set on Vercel Production.