Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to do a eventsub-subscription? #109

Closed
adriel opened this issue Oct 2, 2021 · 2 comments
Closed

Possible to do a eventsub-subscription? #109

adriel opened this issue Oct 2, 2021 · 2 comments

Comments

@adriel
Copy link

adriel commented Oct 2, 2021

https://dev.twitch.tv/docs/eventsub/eventsub-subscription-types#channelupdate

There is some documentation, but I'm struggling to understand how to setup a channel.update subscription to my callback URL using this twitch-cli.

I can get broadcaster details as a one time thing twitch api get channels -q broadcaster_id=9679595 , but to get it to happen automatically via the callback url, I'm not sure.

Is there somewhere with examples of how I should translate the dev.twitch.tv api page into something that'll work with this cli command.
I'm trying to migrate my old WebSub code to use this cli, but a bit lost. Any push in the right direction would be greatly appreciated.

@BarryCarlyon
Copy link
Contributor

The CLI is just a test tool to send an example payload to your EventSub Callback.

So you don't have to use the dashboard/live Twitch to Trigger a "Channel update"

Essentailly the migration from WebSub to EventSub is straightforward:

  • Challenges are over POST now instead of GET
  • The Signature is calculated slightly differently.
  • The payloads are a different format

Depending on your language of choice, I have a node and a PHP example over at https://github.com/BarryCarlyon/twitch_misc/tree/main/eventsub/handlers

And you can use the CLI to punt test messages at your callback based on my code.

So the CLI just does the same thing as the live website does. It's just easier to spam a CLI command than to ask the live system to do send a payload. (and lets you test parsing subscriber data without needing an affiliate or partner or to spend money to trigger an event)

@adriel
Copy link
Author

adriel commented Oct 4, 2021

ooh, that would certainly explain my struggle to find the documentation for it. Updated my old code from WebSub to EventSub and seems to be working now. Will have to give this cli a try to send some dummy events through.

Thank you for the clear and thorough reply.

@adriel adriel closed this as completed Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants