scribase
Scribase Mail

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.

sh
npm install resend

A route handler

POST a recipient and subject to your own API route, which calls Scribase Mail server-side.

app/api/send/route.tsts
// 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.tsts
// 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.

Scribase Mail plans (USD a month), from the live /billing/plans endpoint
PlanPriceEmails a monthDaily cap
Free$03,000 emails a month100 emails a day
Pro$2050,000 emails a monthNo daily cap
Scale$90150,000 emails a monthNo daily cap
FAQ

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.