Node.js
Track events from API servers, CLIs, scripts and cron jobs.
Install#
npm i @shipabase/jsUse the Node entry#
import { init, trackEvent, flush } from "@shipabase/js/node"; init(process.env.SHIPABASE_KEY!, { appVersion: "2.3.0" }); trackEvent("report_generated", { pages: 12, format: "pdf" }); // Short-lived process? Flush before exit.await flush();- Uses the global
fetch(Node 18+). - Reads the OS from
process.platformandos.release(), and the locale fromIntl. - Its timer never keeps your process alive. In short-lived processes,
await flush()before exit.