Hello all, hopefully this isn’t too repetitive but I haven’t been able to find an exact solution to the issue I’m facing.
I’m using Golang and HelixV2 to interface with the Twitch API to capture twitch events, but I’m having an issue getting the EventSub subscription created correctly. I’ve been able to call the API in general for basic things like these two calls
resp, err := helixClient.GetUsers(&helix.UsersParams{
Logins: []string{"whitegrimreaper_"},
})
eventSubResp, err := helixClient.GetEventSubSubscriptions(&helix.EventSubSubscriptionsParams{
Status: helix.EventSubStatusEnabled, // This is optional.
})
but I seem to be having an issue with the Oauth authorization. I saw this thread and have done a request through both the auth code flow and client credentials flow but neither of those access tokens seems to work correctly. Same is true for this other thread discussing the same topic. After doing the auth flow and getting a new app access token from the client credentials flow, I still get a subscription missing proper authorization
error.
I’ve followed the Auth code flow and allowed access for my app (I can see the app in my account Connections), but no matter which token I use I still cannot subscribe to Eventsub. The relevant calls are below, ClientID and ClientSecret are from the app dashboard, broadcaster and bot ids are the twitch ids for my channel and bot account respectively, and AppAccessToken I have tried to switch between every Oauth token I’ve gotten at any stage in the process and none of them work.
helixClient, err := helix.NewClient(&helix.Options{
ClientID: clientId,
ClientSecret: clientSecret,
AppAccessToken: accessToken,
})
resp, err := client.CreateEventSubSubscription(&helix.EventSubSubscription{
Type: helix.EventSubTypeChannelFollow,
Version: "2",
Condition: helix.EventSubCondition{
BroadcasterUserID: os.Getenv("BROADCASTER_ID"),
ModeratorUserID: os.Getenv("BOT_ID"),
},
Transport: helix.EventSubTransport{
Method: "webhook",
Callback: "https://localhost:443",
Secret: "aaaaaa",
},
})