@termind/node
v1.0.1
Published
Termind analytics for Node, Bun and edge runtimes. Server-side events, revenue and AI crawler tracking.
Maintainers
Readme
@termind/node
Termind for your server. Node 18+, Bun and edge runtimes.
npm install @termind/nodeimport { createTermindServer } from "@termind/node";
const termind = createTermindServer({ apiKey: process.env.TERMIND_API_KEY! });
termind.track("trial_started", { personId: "user_123" }, { plan: "pro" });
await termind.revenue({
personId: "user_123",
amountMinor: 4900, // whole cents, never 49.00
currency: "EUR",
plan: "Growth",
});
await termind.flush(); // serverless functions exit fastThree things only a server can do honestly
Events an ad blocker cannot eat. A browser can be blocked; your handler cannot.
Revenue reported from the code that took the payment. The number is the number.
AI crawler tracking. Crawlers fetch HTML and leave without running any JavaScript, so no browser SDK will ever see one.
// middleware.ts
await termind.crawl({
path: url.pathname,
userAgent: request.headers.get("user-agent"),
// Forward the IP so the claim can be verified. A user-agent is a string
// anyone can set; without an address it cannot be confirmed.
ip: request.headers.get("x-forwarded-for")?.split(",")[0] ?? null,
});The server key starts with sk_ and must never reach a browser. The
publishable pk_ key is the one that is safe in public HTML.
Identity is passed per call rather than held on the instance, because a server handles many people at once and an ambient "current user" is a race condition waiting for its first concurrent request.
Docs: https://www.termind.tech/docs/sdks
