SDKs

Track from anywhere

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

Quickstart

Initialize once and 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: 'ada@example.com', 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 in extras:
Pug.track.signup(extras: {'plan': 'pro'});
import { Pug } from '@pug-sh/node'

const pug = new Pug({ apiKey: process.env.PUG_PRIVATE_KEY })

// Server events name the user explicitly: no ambient session.
pug.track('user_123', 'order_completed', { amount: 49.0 })
await pug.identify('user_123', { email: 'ada@example.com' })
// Private keys can also read: profiles and insight queries.
const profile = await pug.profiles.getByExternalId('user_123')
require "pug"

pug = Pug::Client.new(api_key: ENV.fetch("PUG_PRIVATE_KEY"))

# Server events name the user explicitly: no ambient session.
pug.track("user_123", "order_completed", amount: 49.0)
pug.identify("user_123", email: "ada@example.com", plan: "pro")
# Private keys can also read: profiles and insight queries.
profile = pug.profiles.get_by_external_id("user_123")
Available now

Production-ready SDKs

The client SDKs, Web and Flutter, authenticate with your public key and are safe to ship in an app bundle. The server SDKs, Node and Ruby, use 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

Flutter

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

flutter pub add pug_flutter
Available

Node

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

npm install @pug-sh/node
Available

Ruby

Server-side events plus profile and insight reads from Rails or plain Ruby, thread- and fork-safe under Puma and Sidekiq.

bundle add pug-sh
On the roadmap

More platforms on the way

Native SDKs in active development, 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 hello@pug.sh