UNPKG

@posthog/nextjs-config

Version:

NextJS configuration helper for Posthog 🦔

35 lines (34 loc) • 1.01 kB
import type { NextConfig } from 'next'; type NextFuncConfig = (phase: string, { defaultConfig }: { defaultConfig: NextConfig; }) => NextConfig; type NextAsyncConfig = (phase: string, { defaultConfig }: { defaultConfig: NextConfig; }) => Promise<NextConfig>; type UserProvidedConfig = NextConfig | NextFuncConfig | NextAsyncConfig; export type PostHogNextConfig = { personalApiKey: string; envId: string; host?: string; verbose?: boolean; sourcemaps?: { enabled?: boolean; project?: string; version?: string; deleteAfterUpload?: boolean; }; }; export type PostHogNextConfigComplete = { personalApiKey: string; envId: string; host: string; verbose: boolean; sourcemaps: { enabled: boolean; project?: string; version?: string; deleteAfterUpload: boolean; }; }; export declare function withPostHogConfig(userNextConfig: UserProvidedConfig, posthogConfig: PostHogNextConfig): NextConfig; export {};