Docs Local sandbox
Local sandbox
Send without waiting on DNS using the local Docker sandbox (API :18080, dashboard :18081).
Use the local sandbox when you want a first successful send without publishing SPF/DKIM/DMARC for a real domain. Mail goes to GreenMail instead of the public internet. Never use production API keys in sandbox examples or scripts.
Start the sandbox
From the backend/ directory:
docker compose -p resender-sandbox -f docker-compose.yml -f docker/local-sandbox/compose.sandbox.yml up --build -d
| Service | URL / port |
|---|---|
| API | http://localhost:18080 |
| Dashboard | http://localhost:18081 |
| Landing (optional) | http://localhost:18082 |
| GreenMail SMTP / IMAPS / API | :13025 / :13993 / :18083 |
| RabbitMQ UI | :15673 |
Create a sandbox API key
- Open the sandbox dashboard and register or sign in (sandbox-only accounts).
- Add a sending domain and sender identity as the dashboard guides (sandbox DNS is not production DNS).
- Create an API key and copy it once into a local env var, for example
RESENDERMAIL_API_KEY. Do not commit it. Do not reuse a production key.
Send with the Node SDK
Point the client at the sandbox API with baseUrl. Keep the key in server-side env only.
import { ResenderMail } from 'resendermail';
const resender = new ResenderMail(process.env.RESENDERMAIL_API_KEY!, {
baseUrl: 'http://localhost:18080',
});
const { id, status } = await resender.emails.send({
from: 'Sandbox <noreply@resendermail.test>',
to: ['you@example.com'],
subject: 'Sandbox hello',
html: '<p>Hello from the local sandbox</p>',
text: 'Hello from the local sandbox',
});
// status === 'Queued' means accepted; look up with emails.get(id)
Raw HTTP works the same way: POST http://localhost:18080/api/v1/emails with header X-API-Key (not Bearer). See Send email and OpenAPI for the body shape.
Production next
When you are ready for real delivery, follow Get started: verify your domain DNS, create a production key on app.resendermail.com, and omit baseUrl (default https://api.resendermail.com).