How the pieces connect
The split is clean: the Resend SDK is server-only, so every resend.emails.send() call lives behind a Route Handler (app/api/.../route.ts), a Server Action, or a Server Component — never a Client Component. RESEND_API_KEY is read from process.env on the server, so the key never ships in the client bundle.
Templates are React. With react-email you write components in emails/ and pass them straight to the react field of send():
import { Resend } from 'resend';
const resend = new Resend(process.env.RESEND_API_KEY);
await resend.emails.send({
from: 'Acme <hello@yourdomain.com>',
to: user.email,
subject: 'Welcome',
react: <WelcomeEmail name={user.name} />,
});
Resend renders the JSX to HTML server-side, so the same prop-driven component pattern you use for pages drives your emails.