Skip to main content
Encore is an open-source TypeScript framework that provisions infrastructure directly from your application code, with built-in observability and cloud deployment.

Use this pre-built prompt to get started faster.

Open in Cursor

Prerequisites

Before you start, you’ll need:

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 .env files needed:
Initialize the client using the secret:
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:
email/topic.ts
Then publish from any endpoint:
6

Run the app

Your API is running at 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