Sentry Integration

I'm currently integrating Sentry reporting and I wanna ask what's the best way to add a function that reports all trpc errors to Sentry
Something like a middleware
https://github.com/trpc/examples-next-prisma-starter/blob/5158b825a2c236e19ef1e7128f86021498fc833c/src/pages/api/trpc/%5Btrpc%5D.ts#L14-L22
I found this but I'm trying to implement it in the API package, not the next js api
packages/api/src/trpc.ts
GitHub
🚀 tRPC starter repo with E2E-testing. Contribute to trpc/examples-next-prisma-starter development by creating an account on GitHub.
Was this page helpful?