canaryhub
v0.1.0
Published
CanaryHub SDK — business events and error reporting for indie hackers
Readme
canaryhub
Business events and error reporting for CanaryHub — get pinged on Telegram/SMS when things happen in your app.
Install
npm i canaryhubUse
import { canary } from "canaryhub";
canary.init("ch_live_..."); // or set CANARY_API_KEY and call canary.init()
canary.event("signup");
canary.event("payment", { value: 29 });
canary.error("stripe webhook failed", { message: err.message });That's the whole API. Events are batched (20 events / 5 s) and sent fire-and-forget — the SDK never throws, never blocks a request, and silently drops events if the network is down. Call await canary.flush() before process exit if you need the last batch out (e.g. end of a serverless handler).
Options
canary.init("ch_live_...", {
url: "https://ingest.canaryhub.ai/api/v1/events", // default
flushIntervalMs: 5000,
maxBatch: 20,
});