I need help with debugging my webhooks, so I already have a webhook setup and it is currently living in an aws lambda function. I have correctly responded to the challenge and I know for sure that I’m currently subscribe to eventsub since I use the get method for subscription and I see my subscription there with my id. I also know that my callback is working because I can test it with the Twitch cli and it is responding with 200, and my cloudwatch also logs them properly, so I know my lambda function really receives those test event.
But now when I actually tried to do some real events on my account like following it with another user, it does not receive any notification. So basically, my partner’s twitch account will unfollow my page, then wait for about a minute and then follow it again, but I don’t receive any event, the lambda function is not even firing since at the very top I have a simple console log to see if it will fire.
I have the scope of “moderator:read:followers” and I’m currently subscribe to “channel.follow”.
I also tried to delete my subscription and resub again but still no effect. But when I do it with my CLI, it works normally.
Also, not related but why is the headers for event sub not uniform? The challenge header has a camel case but the notification header has a lower case, it’s weird…
This generally won’t work as twitch will attempt to reduce spam and prevent refollows notifiy.
Thats for all things that nofity for follows like email and so on.
channel.update is likely more reliable to test with than (re)follows
the HTTP specfiication states the casting of headers is irrelevant.
Most libraries will convert the key names of headers to all lower case during capture of the HTTP request.
Ohh yeah that’s what I figured, therefore, I added the stream.online and stream.offline on my subscription and tried going live but yeah my endpoint still didn’t receive any.
Yup just found this a while ago, and it’s current status is webhook_callback_verification_failed and I’m assuming because I’m not returning the correct challenge.
Eyyyy, it works! status is now set to enabled, Thank you!
Here’s my solution:
This is mainly for aws lambda, make sure to set the content-type to text/plain, and then for some reason even tho I have set the return on my challenge handler, the function still runs and also returns the 200 at the very bottom so technically I’m also returning a wrong challenge, so just make a response variable at the top and update this inside the challenge function and finally just do one return response at the very end
EDIT: I just freaking realize while reading my own post that I’m not actually returning anything on my challenge handler function because that’s a separate function and by default I’m just returning outside of that function