최근에 나온 amplitude Browser SDK 기준으로 작성된 글 입니다.
Invalid id length for user_id or device_id
Browser SDK는 HTTP2 API를 사용하고 이벤트에 대한 동일한 제약조건을 가진다.
이때 계측 문제를 방지하기위해 user_id 와 device_id가 5자미만인 경우 400에러를 내며 거부한다.
해결 방법으로는 min_id_length를 옵션으로 init해주면 된다.
주의: init의 세번째 매개변수 object에 적어주면 된다.
amplitude.init('토큰', undefined, {minIdLength: 1,});
관련 문서
https://www.docs.developers.amplitude.com/data/sdks/typescript-browser/#initialize-the-sdk
Browser SDK - Amplitude Developer Center
The Amplitude Browser SDK Installation & Quick Start guide.
www.docs.developers.amplitude.com
HTTP V2 API - Amplitude Developer Center
Use the HTTP API V2 to send data directly from your server to the HTTP V2 endpoint.
www.docs.developers.amplitude.com
Invalid id length for user_id or device_id | Community
Hello!I'm getting this error when using .identify method from @amplitude/nodeIn fact, the user_id im using has less than 5 characters and I do understand that this is the HTTP v2 API rule.But the point is, I have thousands of users in my project that ha
community.amplitude.com