TypeScript SDK for the NitroPing audit log — batching client, error capture, Hono/Express/Nitro adapters, and GenAI cost tracing.
TypeScript SDK for the NitroPing audit log — batching client, error capture, framework adapters, and GenAI cost tracing.
npm install nitroping
import { NitroPing } from "nitroping"
const nitroping = new NitroPing({ apiKey: process.env.NITROPING_API_KEY! })
nitroping.track({
action: "invoice.updated",
actor_id: "usr_1",
target_type: "invoice",
target_id: "inv_42",
})
Every GenAI call becomes a row with gen_ai_provider, gen_ai_model, token
counts and cost_usd as real columns — so a spend can be summed or tokens
grouped by model, rather than dug out of a metadata blob.
Full documentation, including all eighteen GenAI integrations →
| Import | What it gives you |
|---|---|
nitroping |
The client, error capture, spans, uuidv7 |
nitroping/hono |
Hono middleware |
nitroping/express |
Express middleware + error handler |
nitroping/nitro |
Nitro (h3) plugin |
nitroping/genai |
Provider wrappers, pricing, cost estimation |
nitroping/schema |
The Zod event schema (the only entry that needs zod) |
Sign in at panel.nitroping.dev and create one
under Settings → API keys. The value is shown once and only its hash is stored,
so a lost key is replaced, never recovered.
Events go to ingest.nitroping.dev; its reference renders at
ingest.nitroping.dev/docs.
cd js
pnpm install
pnpm test # lint + typecheck + vitest
pnpm build
Releases are cut with ./bump.sh <X.Y.Z>; pushing the tag publishes to npm
from CI via npm’s Trusted Publisher (OIDC), so no token lives in the repo.
Through v0.2.14 this repository held the client libraries for NitroPing push
notifications, in seven languages. That project is retired; its final state is
kept on the backup/push-notifications-v0.2.14 branch and every v0.2.x tag
and npm version remains published. v1.0.0 onward is the audit-log SDK.
MIT © productdevbook