* feat: associate errors to users on api v1 * Added webapp * Update layout.tsx * Update captureUserId.ts
9 lines
265 B
TypeScript
9 lines
265 B
TypeScript
import { setUser as SentrySetUser } from "@sentry/nextjs";
|
|
import type { NextMiddleware } from "next-api-middleware";
|
|
|
|
export const captureUserId: NextMiddleware = async (req, res, next) => {
|
|
if (req.userId) SentrySetUser({ id: req.userId });
|
|
|
|
await next();
|
|
};
|