Last active
March 24, 2023 18:04
-
-
Save malerba118/7e0138e1c810a25bb414cc1b4a976722 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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