amplitude / Amplitude-Node

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

Is it possible to set `min_id_length`? #64

Closed tom-james-watson closed 3 years ago

tom-james-watson commented 3 years ago

In the documentation for the HTTP API, https://developers.amplitude.com/docs/http-api-v2#properties-2 , a min_id_length is mentioned that allows overriding the check that user_id must be at least 5 chars long:

Validation on user_id length (must be 5 or more characters unless overrided with min_id_length)

I have some user ids which are < 5 chars and am getting 400 responses when sending events. Is there any way to set this min_id_length if using the node SDK? It doesn't seem possible from looking at the codebase.

jooohhn commented 3 years ago

We'll add an option for this, but something to note is that short ids are often associated with instrumentation issues

kelsonpw commented 3 years ago

@tom-james-watson we will be releasing this behavior this week. you will be able to pass minIdLength: number in your options object when calling init.

KazankovMarch commented 2 years ago

@jooohhn could you please explain, what do you mean by "instrumentation issues"? I have a numeric user_id and I wonder should I add leading zeros to ids below 10000, or just set min_id_length option

bjornbos commented 1 year ago

@jooohhn Could you please provide an answer to this question of why shorter ids would lead to "instrumentation issues"?