Skip to content

Instantly share code, notes, and snippets.

@malerba118
Last active March 24, 2023 18:04
Show Gist options
  • Save malerba118/7e0138e1c810a25bb414cc1b4a976722 to your computer and use it in GitHub Desktop.
Save malerba118/7e0138e1c810a25bb414cc1b4a976722 to your computer and use it in GitHub Desktop.
import { Webhooks, Event } from "@resend/next";
// do signing secret check internally to verify entity calling endpoint
const webhooks = new Webhooks(process.env.RESEND_SIGNING_SECRET);
webhooks.on(Event.EmailDelivered, (data) => {
// data object is fully-typed according to event type
});
webhooks.on(Event.EmailOpened, (data) => {
// data object is fully-typed according to event type
});
export default webhooks.handler;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment