Building reliable event-driven systems usually means stitching together messaging infrastructure, retries, dead-letter handling, and observability across every environment. With Encore, you define the events and handlers in code, then run locally or deploy with the complete system automatically provisioned and traced.
A topic is a typed variable. Publishing is a method call. A subscription declares its handler. There’s no broker to configure, no queue to create in a console, and no YAML to keep in sync.Event types are checked at compile time, so invalid messages are caught before they reach production.
import { Topic, Subscription } from "encore.dev/pubsub";
export interface SignupEvent {
userID: string;
}
export const signups = new Topic<SignupEvent>("signups", {
deliveryGuarantee: "at-least-once",
});
// Publish from anywhere in your app.
await signups.publish({ userID: id });
// Subscribe from any service.
new Subscription(signups, "send-welcome-email", {
handler: async (event) => {
await sendWelcome(event.userID);
},
});Encore starts your app with working Pub/Sub infrastructure on your machine, so you can publish an event and watch it move through every subscription before you commit anything.No emulators to configure, no cloud queue to share with your team, and no mocks standing in for the thing you actually need to test.
Started by Encore when you run your app.
Async systems are hard to debug because the story is spread across services. Encore traces the publish, the delivery, and each subscription handler as one request, so a failure three hops downstream is still attached to the event that caused it.Retries and dead-letter events show up in the same view, with the payload and the error that put them there.
The same declarations become managed queues in your cloud: GCP Pub/Sub, or Amazon SNS and SQS. Encore provisions them with least-privilege IAM, so only the services that publish or subscribe can reach them.Everything runs in your account, under your billing and compliance boundary, with full console access to every resource.
Same declarations, provider-native infrastructure on each side.
“What used to take days or weeks of back-and-forth between developers and infra teams is now automated and completed in minutes.”
Install Encore, then use your AI agent to build, run, and deploy an event-driven app with real infrastructure in minutes.
Paste into your coding agent to install Encore and scaffold an app.