Configuration
Pass an options object to either provider to customise behaviour.
tsx
<NohmoNextProviderprojectId="..."apiKey="..."options={{flushInterval: 5000, // ms between batch flushes (default 3000)debug: true, // log events to the consoleautoPageView: true, // send PAGE_VIEW on route change (default true)autoScrollDepth: true, // track scroll milestones (default true)autoTimeSpent: true, // track time on page (default true)autoCapture: true, // capture clicks automatically (default true)}}>
| Option | Type | Default | Description |
|---|---|---|---|
| flushInterval | number | 3000 | Milliseconds between event batch flushes |
| debug | boolean | false | Log all events and state to the browser console |
| autoPageView | boolean | true | Send a PAGE_VIEW when the SDK initialises. Route changes are tracked by NohmoProvider in Next.js and by usePageView() elsewhere |
| autoScrollDepth | boolean | true | Track scroll depth at 25 / 50 / 75 / 100% |
| autoTimeSpent | boolean | true | Send TIME_SPENT with seconds when leaving a page |
| autoCapture | boolean | true | Capture click events automatically |
| autoErrors | boolean | true | Capture uncaught exceptions, unhandled rejections and failed fetch/XHR requests |
| release | string | '' | Build/version string, so errors and metrics can be attributed to a deploy |
| attributionParams | string[] | ['ref'] | Extra query params treated as campaign sources alongside UTM |