@kody/resend
Send transactional email and manage Resend domains, audiences, and templates with dry-run mutations.
Files
@kody/resend
Intent
Reusable Resend helpers so Kody agents can send transactional email and manage
sending domains, audiences/contacts, templates, and draft-first broadcasts on
the caller's Resend account — not a shared platform inbox. Auth is a saved
API key by default, or an optional OAuth integration. Reads are free-form;
mutations support dryRun: true, and sends or deletes also require
confirm: true.
This listing is meant to be forked. After you fork, save your own resend
credential and call the helpers in your account.
Share this package as https://kody.codes/@kody/resend
(never a /community/{listing_id} URL).
What it does
- Send, batch, schedule, or cancel transactional email
- Manage sending domains (create, verify, tracking, delete)
- Maintain contacts, segments, and topic preferences
- Create broadcast drafts for human review; send only with explicit confirm
- Manage templates; read API key metadata, webhooks, and logs
- Escape-hatch transport pinned to
https://api.resend.com
This package declares no package-owned jobs.
Prerequisites / setup
Default auth is a Resend API key (secret-backed). There is no built-in platform OAuth app. Do not paste the key into chat.
- Create an API key at resend.com/api-keys.
Prefer a key limited to the permissions you need. Sending also needs a
verified domain (or Resend's
onboarding@resend.devtest sender, which only delivers to your account email). - Save it in Kody:
https://kody.codes/account/secrets/new?name=resend&description=Resend%20API%20key%20(re_)%20for%20transactional%20email%2C%20domains%2C%20audiences%2C%20and%20templates&allowedHosts=api.resend.com&scope=user
- In the account secrets UI, approve host
api.resend.com. Saving the secret does not approve hosts by itself. - Agents: see
AGENTS.mdfor import paths, smoke checks, and mutation snippets.
Optional OAuth
Resend supports OAuth 2.1 + PKCE with Dynamic Client Registration — no
dashboard app is required. Redirect URI must be exactly
https://kody.codes/connect/oauth.
- Register a public client (
registerOauthClientin this package) or follow Building a Resend OAuth client. - Open the hosted connect flow while signed in, enter the
client_id, and approve:
https://kody.codes/connect/oauth?provider=resend&authorizeUrl=https%3A%2F%2Fapi.resend.com%2Foauth%2Fauthorize&tokenUrl=https%3A%2F%2Fapi.resend.com%2Foauth%2Ftoken&scopes=full_access&allowedHosts=api.resend.com&apiBaseUrl=https%3A%2F%2Fapi.resend.com&dashboardUrl=https%3A%2F%2Fresend.com
- Pass
integration: "resend"on every call.emails:sendonly covers sending routes; domains, contacts, templates, and logs needfull_access.
Multi-account
There are no hard-coded account aliases:
- Token lane:
account: "work"reads secretresend-work, or passsecretName: "resend-work". - OAuth lane: pass
integration: "resend-work".
https://kody.codes/account/secrets/new?name=resend-work&description=Resend%20API%20key%20for%20the%20work%20account&allowedHosts=api.resend.com&scope=user
Hosts, 401, and 403
| Status | Meaning | Next step |
|---|---|---|
| 401 | Missing or invalid API key / expired OAuth token | Save resend at the secrets URL, or reconnect OAuth |
| 403 + domain | from is not on a verified sending domain | listDomains(), add DNS, verifyDomain |
| 403 + scope | OAuth connected with emails:send but a management route was called | Reconnect with full_access |
| 429 | Rate limit (default 2 req/s) | Back off, or use sendBatch |
Approve api.resend.com on the secret or integration. Host approval lives
in the account security UI.
Done when
- Secret
resendis saved (orresendOAuth is connected);api.resend.comis approved - Smoke test returns
{ ok: true, live: false }plus setup URLs without credentials, or lists domains / recent sent email with credentials (no writes) - Mutations preview with
dryRun: true; sends and deletes also needconfirm: trueafter you approve the exact payload
Branding
community-icon.svg uses Resend's official lettermark path from
cdn.resend.com/brand/resend-icon-white.svg
on black. The path is unmodified. Resend® is a trademark of Resend. This
package is not affiliated with or endorsed by Resend.