EventSub websockets subscriptions failing

The docs superseed the RFC. And one of the things that changed from the RFC is the move to use a session_id

You can use this live example and inspect the requests in chrome inspector - https://barrycarlyon.github.io/twitch_misc/eventsub/websockets/web/basic/

It does the following steps

  • implicit auth to get a token
  • connect to the websocket
  • get the session ID
  • create 6 subscriptions to the users own data

So your subscription payload looks correct, I’m just not sure if it’s correct.

So copying one of these “as curl” from my example

curl 'https://api.twitch.tv/helix/eventsub/subscriptions' \
  -H 'authority: api.twitch.tv' \
  -H 'accept: */*' \
  -H 'accept-language: en-US,en;q=0.9' \
  -H 'authorization: Bearer REMOVED' \
  -H 'cache-control: no-cache' \
  -H 'client-id: hozgh446gdilj5knsrsxxz8tahr3koz' \
  -H 'content-type: application/json' \
  -H 'dnt: 1' \
  -H 'origin: https://barrycarlyon.github.io' \
  -H 'pragma: no-cache' \
  -H 'referer: https://barrycarlyon.github.io/' \
  -H 'sec-ch-ua: "Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: cross-site' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36' \
  --data-raw '{"type":"channel.follow","version":1,"condition":{"broadcaster_user_id":"15185913"},"transport":{"method":"websocket","session_id":"AQoQgx4U5m9MSRWtUIghgSjI8BAB"}}' \
  --compressed