This is based on TTD UID2 generate/refresh enpoints encryption requirements. There is only Python example in official document, and the encryption rule is kinda complicated. That's the reason I made this JS version for quick translation.
-
Fill out your AUTH_TOKEN and SECRET_KEY in
.envfile. -
run
npm run generateto generate UID2 Token by a specific Email. -
run
npm run refresh <refreshResponseKey> <refreshToken>to get a new UID2 Token withrefreshResponseKeyandrefreshTokenas arguments.