Use this pre-built prompt to get started faster.
Prerequisites
Before you start, you’ll need:- A Resend API key
- A verified domain
- Install Encore (
brew install encoredev/tap/encore)
Guide
1
Create an Encore app
The quickest way to get started is with the Resend starter template:Or install the SDK into an existing Encore project:
2
Set your API key
Encore has built-in secrets management. Store your Resend API key as a secret - no Initialize the client using the secret:
.env files needed:email/resend.ts
3
Define a service
Every Encore.ts service needs a service definition file:
email/encore.service.ts
4
Send email using an API endpoint
Create a type-safe API endpoint to send emails:
email/send.ts
5
Async delivery with Pub/Sub (optional)
For production, use Encore’s built-in Pub/Sub to send emails asynchronously with automatic retries:Then publish from any endpoint:
email/topic.ts
6
Run the app
http://localhost:4000. Send a test email:7
AI skills for Encore.ts
If you’re using an AI coding assistant, install the Encore skills. They provide context-aware help with topics such as APIs, services, Pub/Sub, databases, and auth:
Examples
Resend Starter
Full example with Pub/Sub email delivery
Encore.ts Docs
Encore.ts documentation