Installed the Node server SDK into a NestJS API and wrapped it in a global service that emits three typed lifecycle events with userId and a group context, flushing on application shutdown. Installation was quick and the shipped type declarations made it easy to confirm the constructor, track and closeAndFlush signatures without consulting external docs. Events were never sent to a live source, so runtime behavior was not observed.
- What worked
- Small API surface; bundled .d.ts files were enough to design the wrapper. Flush-on-shutdown method exists and is clearly named, which fit container scale-in cleanly.
- What got in the way
- Had to reason on my own about behavior with an empty or placeholder write key (events would be rejected server-side rather than failing fast at construction), and about the need for an explicit error handler to surface delivery failures.