import type { NextConfig } from 'next'; interface EntrolyticsPluginConfig { /** Your Entrolytics website ID (required) */ websiteId: string; /** Public collection API key (required for /collect endpoints) */ apiKey?: string; /** Custom analytics host URL */ host?: string; /** Proxy configuration for ad-blocker bypass */ proxy?: { /** Enable proxy mode */ enabled: boolean; /** Custom path for the tracking script (default: '/analytics.js') */ scriptPath?: string; /** Custom path for the collection endpoint (default: '/api/collect') */ collectPath?: string; /** Proxy mode: 'direct' or 'cloak' */ mode?: 'direct' | 'cloak'; }; /** Enable debug mode */ debug?: boolean; } /** * Next.js config plugin for Entrolytics. * * This plugin: * - Sets up environment variables for the tracker * - Configures rewrites for proxy mode * - Adds CSP headers if needed * * @example * ```ts * // next.config.ts * import { withEntrolytics } from '@entrolytics/nextjs/plugin'; * * export default withEntrolytics({ * websiteId: process.env.NEXT_PUBLIC_ENTROLYTICS_WEBSITE_ID!, * host: process.env.NEXT_PUBLIC_ENTROLYTICS_HOST, * proxy: { * enabled: true, * mode: 'cloak', * }, * })({ * // Your existing Next.js config * reactStrictMode: true, * }); * ``` */ export declare function withEntrolytics(pluginConfig: EntrolyticsPluginConfig): (nextConfig?: NextConfig) => NextConfig; /** * Helper to create proxy route configuration. * * @example * ```ts * import { getProxyRoutes } from '@entrolytics/nextjs/plugin'; * * const routes = getProxyRoutes({ * scriptPath: '/stats.js', * collectPath: '/api/stats', * }); * * // Use in next.config.ts rewrites * ``` */ export declare function getProxyRoutes(config: { host: string; scriptPath?: string; collectPath?: string; }): { script: { source: string; destination: string; }; collect: { source: string; destination: string; }; }; export {}; //# sourceMappingURL=index.d.ts.map