UNPKG

next-axiom

Version:

Send WebVitals from your Next.js project to Axiom.

19 lines (18 loc) 914 B
import { NextConfig } from 'next'; import { LogLevel, Logger } from './logger'; import { type NextRequest, type NextResponse } from 'next/server'; import { RequestJSON } from './shared'; export declare function withAxiomNextConfig(nextConfig: NextConfig): NextConfig; export type AxiomRequest = NextRequest & { log: Logger; }; type NextHandler<T = any> = (req: AxiomRequest, arg?: T) => Promise<Response> | Promise<NextResponse> | NextResponse | Response; type AxiomRouteHandlerConfig = { logRequestDetails?: boolean | (keyof RequestJSON)[]; notFoundLogLevel?: LogLevel; redirectLogLevel?: LogLevel; }; export declare function withAxiomRouteHandler(handler: NextHandler, config?: AxiomRouteHandlerConfig): NextHandler; export declare function withAxiom(param: NextHandler, config?: AxiomRouteHandlerConfig): NextHandler; export declare function withAxiom(param: NextConfig): NextConfig; export {};