Install
npm install @evumi/tracker
# pnpm add @evumi/tracker
# yarn add @evumi/tracker
# bun add @evumi/tracker
The public npm package needs no token. Pin @evumi/tracker@<version> when matching a specific Evumi release. Remove an old @evumi:registry=https://npm.pkg.github.com override when switching to npm. Existing private GitHub Packages consumers can keep using that mirror.
Site settings also provides an instance-hosted SDK archive as a fallback. The downloadable AI integration skill includes the exact package version, collector origin and saved site settings.
Choose your collector
import { createTracker } from '@evumi/tracker';
export const analytics = createTracker({
domain: 'example.com',
apiHost: 'https://analytics.example.com',
routePatterns: ['/products/:id'],
});
domain is the website you created in Evumi. apiHost is the HTTP(S) origin of your Evumi deployment, including an optional port. The SDK sends to that origin's /api/event; do not include an endpoint path, query, fragment or credentials in apiHost.
Use HTTPS in production and allow the collector origin in your website's CSP connect-src. The public collector needs no API key. Stats, Sites, npm and MCP credentials must never be embedded in browser code.
Select one pageview integration
| Framework | Entry | Integration |
|---|---|---|
| JavaScript | @evumi/tracker | Call pageview() after initial load and completed navigation |
| React | @evumi/tracker/react | EvumiProvider and EvumiPageview using your router state |
| Next.js App Router | @evumi/tracker/nextjs | Mount EvumiNext once in a client component |
| Next.js Pages Router | @evumi/tracker/nextjs/pages | Mount EvumiNextPages once in _app |
| TanStack Router / Start | @evumi/tracker/tanstack | Mount EvumiTanStack inside the root route |
| Vue 3 | @evumi/tracker/vue | Install createEvumiPlugin after Vue Router |
| Electron | @evumi/tracker/electron | Use createElectronTracker in the isolated renderer |
All adapters use the same apiHost. Do not mount two automatic pageview integrations or retain an automatic Plausible script alongside the SDK for the same collector. Use Site settings → Installation for complete examples for your framework.
Track business events
// Call only after the operation succeeds.
export function onSignupSuccess() {
void analytics.track('Signup', { props: { plan: 'pro' } });
}
Keep event names consistent with goals and funnel steps. Explicit route templates replace private identifiers in report paths. Avoid personal information in URLs and properties.
Verify
Check the browser's actual POST destination, one initial pageview and one completed navigation. Development on localhost requires captureOnLocalhost: true. HTTP 202 means queue acceptance; verify the event in Evumi after processing. A filtered response is not proof that an event was stored. Geographic attribution happens on the collector; the SDK does not request GPS access. See geography for reporting limits.