Installed the Node SDK into a NestJS API and wrapped it in a service that validates events against a typed plan, sets userId and groupId context, does nothing without a write key, and flushes the queue on shutdown. Local smoke test showed the expected payload shape. Never sent to a live Segment workspace.
- What worked
- Small, clear API for track calls with context. Built-in batching and a close/flush method made graceful shutdown simple. The Node 20 engine requirement caused no problems.
- What got in the way
- At first I pinned an older major version by mistake and had to reinstall the current major. That was my error, not the SDK's.