@sentry/nextjs
Version:
Official Sentry SDK for Next.js
42 lines • 1.47 kB
TypeScript
export interface CreateSentryTunnelRouteOptions {
/**
* The DSNs that the route accepts. It rejects envelopes for other DSNs with a 403.
* Defaults to the DSN of the server SDK.
*/
allowedDsns?: string[];
}
type TunnelRouteHandler = (request: Request) => Promise<Response>;
/**
* Creates a route handler for the `tunnelRoute`, like `POST`, but with your own DSN allowlist.
*
* In most cases, use `export { POST } from '@sentry/nextjs/tunnel'` instead. Use this function only if the route must
* accept DSNs other than the one of the server SDK, for example a different browser DSN.
*
* @example
* ```ts
* // app/sentry-tunnel/route.ts
* import { createSentryTunnelRoute } from '@sentry/nextjs/tunnel';
*
* export const { POST } = createSentryTunnelRoute({
* allowedDsns: ['https://public@o0.ingest.sentry.io/0'],
* });
* ```
*/
export declare function createSentryTunnelRoute(options?: CreateSentryTunnelRouteOptions): {
POST: TunnelRouteHandler;
};
/**
* Route handler for the `tunnelRoute` of `withSentryConfig`. It forwards Sentry envelopes to Sentry, but not the
* request headers (such as cookies).
*
* It accepts envelopes only for the DSN of the server SDK. For other DSNs, use `createSentryTunnelRoute`.
*
* @example
* ```ts
* // app/sentry-tunnel/route.ts
* export { POST } from '@sentry/nextjs/tunnel';
* ```
*/
export declare const POST: TunnelRouteHandler;
export {};
//# sourceMappingURL=index.d.ts.map