Skip to Content
Developer docs

Integrate Pug

Event analytics and user profiles you can wire into any app. Install an SDK or POST straight to the API, watch events flow through the pipeline, and query them back out — self-host the whole thing if you want to.

120+
Typed events
Connect
RPC API
Self-host
Full stack
import { init, track } from '@pug-sh/browser'

init('YOUR_PROJECT_ID', {
  apiKey: 'pub_YOUR_PUBLIC_KEY'
})

track('page_view')
How it worksevent → insight

Events flow from your app through an async pipeline to analytics storage. The same data powers Live, Insights, and Profiles.

SDKtrack() & identify()
APIConnect RPC ingest
NATSAsync pipeline
WorkersGeo & enrichment
ClickHouseAnalytics store
DashboardInsights & profiles
Ways to integratepick your path

Web app

Install the Web SDK (@pug-sh/browser) — auto-track page views and clicks, identify users on sign-in.

Quickstart

Mobile app

Typed event tracking, screen and lifecycle auto-tracking, and identity for Flutter apps.

Flutter setup

Backend or any language

Send events and read analytics from a Node.js backend with the Node SDK — or POST straight to the Connect RPC API from any other language.

Node SDK

Query your data

Read insights and profiles programmatically with your private key — via the Node SDK or the Connect API.

API reference

Self-host

Run the full stack — Postgres, ClickHouse, NATS, Dragonfly, and the Go workers — on your own infrastructure.

Self-hosting guide

Jump straight in

Copy-paste SDK snippets for tracking events and identifying users.

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

track('button_clicked', { label: 'Sign up' })
track('purchase', {
  productId: 'sku_123',
  amount: 29.99,
  currency: 'USD'
}, { immediate: true })