amplitude / Amplitude-Node

Server-side Node.js SDK for Amplitude
MIT License
67 stars 20 forks source link

feat(min_id_length): Add support and tests for new SDK option `minIdLength` #71

Closed kelsonpw closed 3 years ago

kelsonpw commented 3 years ago

Summary

This implements the behavior requested in #64

This PR adds a new option to the Node SDK, options.minIdLength -> number | null | undefined. It also adds the necessary logic to append the options: { minIdLength: x } key:value pair to the payload send to the HTTP api.

Adds 2 tests to confirm that the payload being sent is modified correctly based on minIdLength being passed as an option, aswell as confirming that the payload is untouched if minIdLength is null or undefined.

Checklist