Product analytics for Node.js
For events that must be trusted — payments, server jobs, webhooks — use the Pug Node SDK. It names the user explicitly (no ambient session) and can read profiles and insights back with a private key.
Uses the Pug Node SDK — Pug’s one SDK for the server.
npm install sdk-node import { Pug } from 'sdk-node'
const pug = new Pug({ apiKey: process.env.PUG_API_KEY }) // private key, prv_…
// Server events name the user explicitly — no ambient browser session.
pug.track('user_123', 'order_completed', { amount: 49.0, currency: 'USD' })
await pug.identify('user_123', { email: '[email protected]', plan: 'pro' }) Product analytics in your Node.js app
- Server-side track() that names the user explicitly — no ambient browser session
- identify() to set profile traits from trusted server context
- Read back profiles and run insight queries with a private key
- Pairs with the Web SDK: client autocapture plus authoritative server events on one profile
Pug + Node.js — common questions
When should I use the Node SDK instead of the Web SDK?
Use the Node SDK for events that must be trustworthy or happen off the browser — completed payments, subscription changes, background jobs, webhooks. Use the Web SDK for in-page autocapture. They write to the same profile, so a person’s client and server events live on one timeline.
Does the Node SDK autocapture?
No — autocapture is a browser feature. On the server you call track() explicitly with the user id and event name. That’s by design: server events are deliberate, not ambient.
Can the Node SDK read data back?
Yes. With a private key it can fetch profiles by external id and run insight queries, so you can use Pug data inside your own backend logic.
Add Pug to your Node.js app.
Open-source product analytics with unified profiles. Self-host under AGPL-3.0, or use the free cloud during open beta.