FlagFix
Guides

How to track events in Node.js

Identify the request, track, and flush.

Cette page n’a pas encore de traduction française. Le texte anglais fait foi.

Last updated on

const scoped = flagfix.withIdentity({ userId });
await scoped.start();
const receipt = scoped.track("checkout_started", { productId: "p1", amount: 12000 });
await receipt.persisted;
await scoped.flush(1_500);

Match the tracking plan name. Do not send emails or tokens. If flush times out, a persistent queue still holds the event. Memory mode drops it when the process exits.

Cette page vous a-t-elle été utile ?