Install
Add the official SDK to your project.
npm i xurel
Next.js
Add Xurel to any Next.js app with a route handler and React Email.
Add the official SDK to your project.
npm i xurel
Store the key in your environment. Never commit it.
XUREL_API_KEY=xrl_prd_xxxxxxxx
Use an App Router route handler (or Server Action) to send.
import { Xurel } from 'xurel';
import { NextResponse } from 'next/server';
const xurel = new Xurel(process.env.XUREL_API_KEY!);
export async function POST() {
const data = await xurel.emails.send({
from: 'hello@yourdomain.com',
to: 'user@example.com',
subject: 'Hello from Next.js',
html: '<p>It works.</p>',
});
return NextResponse.json(data);
}
More integrations
Create an account, verify your domain, and send in minutes.