Ranla + v0 (Vercel)
v0 generates Next.js apps. Run Ranla from a Route Handler or Server Action and store RANLA_API_KEY in Vercel environment variables.
When to use Ranla
- 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:
RANLA_API_KEY=rnl_your_key_hereVercel — Project → Settings → Environment Variables:
| Name | Environments |
|---|---|
RANLA_API_KEY |
Production, Preview, Development |
Redeploy after adding the variable.
2. Paste this prompt in v0 chat
Integrate Ranla transactional email into this Next.js app.
Docs:
- https://docs.ranla.ai/ai/agent-skill
- https://docs.ranla.ai/frameworks/nextjs
- https://docs.ranla.ai/openapi.yaml
- https://docs.ranla.ai/builders/v0
Rules:
1. RANLA_API_KEY is server-only (process.env) — never use NEXT_PUBLIC_ for the API key.
2. Send via POST https://api.ranla.ai/emails or npm package supersendtx from a Route Handler / Server Action.
3. Sandbox: from "[email protected]", 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 rnl_ keys.
Document that Vercel env var RANLA_API_KEY must be set before deploy.3. Route Handler example
Create app/api/email/send/route.ts:
import { NextResponse } from 'next/server'
import { Ranla } from '@supersend/ranla'
const tx = new Ranla(process.env.RANLA_API_KEY!)
export async function POST(request: Request) {
const body = await request.json()
const result = await tx.emails.send({
from: body.from ?? '[email protected]',
to: body.to,
subject: body.subject,
html: body.html,
text: body.text,
})
return NextResponse.json(result)
}Install: npm install @supersend/ranla
Sandbox
Until your domain verifies, test with the sandbox sender and your Ranla account email — see Agent skill notes.
Production
- Verify domain in Ranla dashboard.
- Set production
fromto your domain. - Confirm
RANLA_API_KEYis set on Vercel Production.