Send email from Next.js
Scribase Mail serves the Resend REST API shape at https://mail-api.scribase.com, so the official resend npm SDK works against it with a new base URL and key — no new SDK to learn. Both patterns below run on Node (route handlers and Server Actions do not work on the Edge runtime with this SDK).
Last checked November 24, 2026.
Install and set a key
Install the resend package (there is no separate Scribase SDK), create a Scribase Mail API key in the dashboard, and store it as SCRIBASE_MAIL_KEY.
npm install resendA route handler
POST a recipient and subject to your own API route, which calls Scribase Mail server-side.
// app/api/send/route.ts
import { Resend } from 'resend';
const resend = new Resend(process.env.SCRIBASE_MAIL_KEY, {
baseUrl: 'https://mail-api.scribase.com',
});
export async function POST(request: Request) {
const { to, subject, html } = await request.json();
const { data, error } = await resend.emails.send({
from: 'Acme <hello@mail.acme.com>',
to,
subject,
html,
});
if (error) {
return Response.json({ error: error.message }, { status: 400 });
}
return Response.json(data);
}Or a Server Action
The same SDK call works directly in a Server Action called from a form or client component.
// app/actions/send-email.ts
'use server';
import { Resend } from 'resend';
const resend = new Resend(process.env.SCRIBASE_MAIL_KEY, {
baseUrl: 'https://mail-api.scribase.com',
});
export async function sendWelcomeEmail(toAddress: string) {
const { data, error } = await resend.emails.send({
from: 'Acme <hello@mail.acme.com>',
to: [toAddress],
subject: 'Welcome',
html: '<p>Thanks for signing up.</p>',
});
if (error) throw new Error(error.message);
return data;
}Verify a sending domain before going live
Real mail needs a verified domain on every plan. Add it in the dashboard or with POST /domains, publish the DKIM, SPF and DMARC records it returns, then verify; the check reads live DNS. An sk_test_ key sends without a verified domain while you build.
| Plan | Price | Emails a month | Daily cap |
|---|---|---|---|
| Free | $0 | 3,000 emails a month | 100 emails a day |
| Pro | $20 | 50,000 emails a month | No daily cap |
| Scale | $90 | 150,000 emails a month | No daily cap |
Questions people ask
Do I need a Scribase-specific SDK for Next.js?
No. There is no published @scribase/mail package. Use the official resend npm package with a baseUrl option or the RESEND_BASE_URL environment variable pointed at https://mail-api.scribase.com.
Can I call this from the Edge runtime?
The resend SDK targets Node; use the Node runtime for the route handler. Plain fetch() against the REST API works from either runtime.
How do I send without a verified domain while developing?
Create an sk_test_ key. Every send with it is simulated, never delivered and not metered, so the whole flow runs with no domain.