Is it a problem that GAS webApp has a header?
Seems like it.
The script needs to return only the challenge
Maybe Class TextOutput | Apps Script | Google for Developers could work? I don’t use google script so can’t verify/test
Seems like that. It works when you go to
https://script.google.com/macros/s/AKfycbzjdZ-Rqc5IhZBkGyJsHshmpknvFq-ilEA9cEvN1cLH0I0Snjc/exec
But subscription is pending for a long time and then webhook_callback_verification_failed
It’s passing the test now
On a create subscription you probably got a HTTP 409 and need to delete the failed subscription first. And your create code ins’t catching the 409 conflict
I deleted once again all subscriptions, then run createSubscription (it gave me response code 202). I got challenge, timeouted for 2 sec and gave challenge back via
function doGet(e){
Utilities.sleep(2000);
var ss = SpreadsheetApp.openById(XXXX).getSheetByName(XXXX)
var chall = ss.getRange('A4').getValue();
return ContentService.createTextOutput(String(chall));
}
It was pending for a while. After few minutes subscription status was webhook_callback_verification_failed.
P.s. I will make a guide how to use GAS with Twitch when I’ll be finally done with that. Poor new enthusiasts like me…
Did you log multi calls to your callback or just one?
I wonder if the CLI test tool will follow the redirect but “Real” eventsub doesn’t.
Since when we hit your callback, it’s redirecting to another place.
One call per one createSubscription. Nothing else.
My webApp url redirects to Google “echo” service which was created by "ContentService.createTextOutput(String(chall)) "
I’m flagging a query to someone upstairs, will check if redirects are allowed.
EventSub doesn’t support “redirects” so you are unable to use Google Script with EventSub
Filed Docs bug: https://github.com/twitchdev/issues/issues/358
Filed twitch-cli bug: https://github.com/twitchdev/twitch-cli/issues/53
May I ask you to check this URL in cli?
https://script.google.com/a/macros/hbmail.ru/s/AKfycbyE5Ss0KvajCGeE7es8SKN7u5NJUu-rIZo4KrTgQtj9RlCo2Uv5/exec
The CLI doesn’t represent what EventSub actaulyl does.
Also you can download and use the CLI yourself on the link
Thanks for CLI link.
I managed to delete that warning banner at the top of site without redirections, but EventSub still don’t want to aprove my challenge.
Strange…
Ok, i got it, it shows everytime for everyone who are anonymous to this script.
well, seems like i have to dig deeper…
So, if EventSub is unable to use with GAS right now, what else I can try to use?
Custom/own server that doesn’t impart weirdness ?
other cloud computing solutions that doesn’t impart weirdness?
Personally I use dedicated servers
I mean another Twtich option (not EventSub) that i could use with GAS (webhooks/signals)?
This seems unlikely given the limitations we’ve already run into with GAS.
And since I don’t use GAS I don’t how any work arounds of valid alternatives. Since I just throw a dedicated server at it and do what I want instead without any blockers
Yeah, I know that dedicated server/local hosting are the simplest way. But first of all I was interesting in connection between GAS and Twitch, so I was trying. Wish there will be a way to manage this in near future
Thanks a lot for your time and help!
It’s at the mercy of the stuff that GAS shoves on top. Which is whats happening here.
GAS intercepts and sends unexpected stuff
Or does a redirect which is a “security concern”