productdevbook / nitroping
Zero-dependency PHP SDK for nitroping push notifications. Send pushes, register devices, verify webhooks.
Package info
github.com/productdevbook/nitroping-sdk
Language:TypeScript
pkg:composer/productdevbook/nitroping
Requires
- php: >=8.2
- ext-curl: *
- ext-hash: *
- ext-json: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.50
- phpstan/phpstan: ^1.11
- phpunit/phpunit: ^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-08-26 18:43:39 UTC
README
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 →
Entry points
| 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) |
Getting an API key
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.
Development
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.
History
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.
License
MIT © productdevbook