UNPKG

better-analytics

Version:

Zero-dependency micro-analytics JavaScript SDK < 3KB gzipped with React/Next.js/Expo support

27 lines (23 loc) 1.1 kB
import { ServerTrackOptions } from '../server.js'; export { ServerAnalyticsConfig, ServerEventData, initServer, stitchSession } from '../server.js'; import '../types-DzHHnKL8.js'; /** * Next.js Server Analytics with Auto-Initialization * * This module extends the base server functionality with auto-initialization * specific to Next.js environments. Other frameworks should use the base * server module directly with explicit initialization. */ /** * Track event from Next.js server with auto-initialization */ declare function trackServer(eventName: string, props?: Record<string, unknown>, options?: ServerTrackOptions): Promise<void>; /** * Track pageview from Next.js server with auto-initialization */ declare function trackPageviewServer(path: string, options?: ServerTrackOptions): Promise<void>; /** * Identify user from Next.js server with auto-initialization */ declare function identifyServer(userId: string, traits?: Record<string, unknown>, options?: ServerTrackOptions): Promise<void>; export { ServerTrackOptions, identifyServer, trackPageviewServer, trackServer };