## TL;DR

Edge does not change key hygiene. - Prefer the SDK when it loads; fall back to raw fetch only when the runtime cannot run it. Do not assume the SDK will render a React component for you there. - The key still comes from the environment.

```text
import { Resend } from 'resend';

const resend = new Resend(process.env.RESEND_API_KEY);

export async function POST() {
  const html = renderMyTemplateToString();
  const { data, error } = await resend.emails.send({
    from: '[SENDER]',
    to: ['[RECIPIENT]'],
    subject: 'Hello World',
    html,
  });
  if (error) {
    return Response.json({ error }, { status: 400 });
  }
  return Response.json({ id: data.id });
}
```

## Steps

1. Edge does not change key hygiene. - Prefer the SDK when it loads; fall back to raw fetch only when the runtime cannot run it.

2. Do not assume the SDK will render a React component for you there. - The key still comes from the environment.

## When to use

You are seeing this: The react prop relies on the Node.js SDK's component rendering. Use this skill when you run into "Resend on an edge runtime: the react prop is Node-SDK-only, send pre-rendered html".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://api.resend.com/emails
