Twitch 'nonce' in requests

In some Twitch requests, it has ‘nonce’ in it. What is this used for and what is it?

There is nothing documented that uses a nonce.

What have you seen on what endpoint(s)?

The PubSub documentation mentions the nonce. A nonce is just a user supplied value that gets sent when Twitch sends out a message so that you can reference something internally if you want, or validate that the message comes from that particular call you made.

Ah PubSub.

Yeah, Nonce is used to link the reply sent by Twitch to the listen request.

Since if you send 10 listens at once you get 10 responses and the nonce is used to ID which response is for each listen attempt.

So if you send 10 listens and get 5 errors and 5 successes, the error message doesn’t say which listen it was, so you use the nonce to link the error to the listen you sent. Elsewhere in development Nonce is often used as a one use token so a repeated request is ignored if the nonce was used already.

The use of “requests” in the Subject implied it was an API call to Helix/Kraken. Hence the confusion.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.