SDKs

Six SDKs, one profile per person

Web, Android, Flutter, Node, Go, and Ruby all send to the same pipeline, so one person’s web, app, and server events land on the same profile.

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 sh.pug.android.Options
import sh.pug.android.Pug

Pug.init(this, "your-project-id", Options("pub_your_key"))
// Call once in Application.onCreate(). Lifecycle, screen
// views and installs are tracked automatically from here.

Pug.identify("user_123", mapOf("plan" to "pro"))
Pug.track.purchase(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')
import pug "github.com/pug-sh/sdk-go"
key := os.Getenv("PUG_PRIVATE_KEY") // private key, prv_...
client, err := pug.New(pug.Options{APIKey: key})
if err != nil {
	log.Fatal(err) // no key, or not a prv_ key
}
defer client.Close(context.Background()) // drains the queues
client.Track("user_123", "signup", pug.String("plan", "pro"))
client.Identify("user_123", pug.Email("ada@example.com"))
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

Client and server SDKs

The client SDKs (Web, Android, and Flutter) use your public key, which is safe to ship in an app bundle. The server SDKs (Node, Go, and Ruby) use a private key, which can also read profiles and insights.

Available

Web

Autocapture, sessions, consent states, and batched delivery for any website or web app.

npm install @pug-sh/browser
Available

Android

Native Kotlin SDK, also callable from Java. Tracks app lifecycle, screen views, and installs automatically, on two runtime dependencies.

implementation("sh.pug:android:0.1.0")
Available

Flutter

Tracks app opens, installs, and screen views on its own, with identity and sessions, for Flutter apps.

flutter pub add pug_flutter
Available

Node

Server-side events that name the user on every call, plus profile and insight reads.

npm install @pug-sh/node
Available

Go

Server-side events plus profile and insight reads for Go 1.26+, with typed properties and well-known events checked at compile time. Tracking never blocks or fails.

go get github.com/pug-sh/sdk-go
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
Available

HTTP API

No SDK for your runtime? Anything that can POST JSON sends events and identifies users through the same Connect API the SDKs call.

POST https://api.pugs.dev
On the roadmap

iOS and React Native are in development

Both use the same events and identity model as the SDKs above.

Coming soon

iOS

Native Swift SDK for tracking and push.

Coming soon

React Native

Cross-platform tracking for React Native apps.

Send your first event.

Create a project, add the snippet, and watch the Live view fill up. Or open the demo first: the real dashboard on a sample pet shop, with no sign-up.

Questions? Email hello@pug.sh