SDKs

Track from anywhere.

Three SDKs ship today — Web, Node, and Flutter. Auto-tracking, identity resolution, and session management in the client; explicit, trusted events from your server.

Quickstart

Initialize once, track everywhere.

import { init, identify, track } from '@pug-sh/browser'

init('your-project-id', { apiKey: 'pub_your_key' })

// Page views, clicks, scrolls, form interactions, rage clicks,
// and dead clicks are captured automatically from here on.
identify('user_123', { email: '[email protected]', plan: 'pro' })
track('signup', { plan: 'pro' })
track('order_completed', { amount: 49.0, currency: 'USD' })
import 'package:pug_flutter/pug_flutter.dart';

await Pug.init('your-project-id', const PugOptions(apiKey: 'pub_your_key'));

// Auto-tracking starts immediately. Identify users on sign-in:
await Pug.identify('user_123', traits: {'plan': 'pro'});

// Typed methods for well-known events (custom props go in extras):
Pug.track.signup(extras: {'plan': 'pro'});
import { Pug } from '@pug-sh/node'

const pug = new Pug({ apiKey: process.env.PUG_API_KEY }) // private key, prv_…

// Server events name the user explicitly — no ambient session.
pug.track('user_123', 'order_completed', { amount: 49.0, currency: 'USD' })
await pug.identify('user_123', { email: '[email protected]', plan: 'pro' })
// Private keys can also read: profiles and insight queries.
const profile = await pug.profiles.getByExternalId('user_123')
Available now

Production-ready SDKs.

The client SDKs authenticate with your public key and are safe to ship in an app bundle. The Node SDK uses a private key, which also unlocks analytics reads.

Available

Web

Browser analytics with auto-tracking, batching, and session management.

npm install @pug-sh/browser
Available

Node

Trusted server-side events with explicit user attribution, plus profile and insight reads.

npm install @pug-sh/node
Available

Flutter

Event tracking, profile identity, sessions, and FCM push for Flutter apps.

flutter pub add pug_flutter
On the roadmap

More platforms, coming soon.

Native SDKs in active development, landing by launch — built on the same event and identity model.

Coming soon

Android

Native Kotlin SDK with provider-neutral push.

Coming soon

iOS

Native Swift SDK for tracking and push.

Coming soon

React Native

Cross-platform tracking for React Native apps.

Ready to understand your users?

Open source and self-hostable. Spin up your first project in minutes.

Questions? Email [email protected]