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
.env
file. -
run
npm run generate
to generate UID2 Token by a specific Email. -
run
npm run refresh <refreshResponseKey> <refreshToken>
to get a new UID2 Token withrefreshResponseKey
andrefreshToken
as arguments.