fix
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { building } from "$app/environment";
|
||||
import { HASH_SECRET, TWITCH_APP_CLIENT_ID, TWITCH_APP_SECRET } from "$env/static/private";
|
||||
import { z } from "zod";
|
||||
|
||||
@ -42,6 +43,10 @@ export const twitchFollowEvent = z.object({
|
||||
// Webhook -> Redeem of channel reward
|
||||
export const createTwitchClient = () => {
|
||||
const getAccessToken = async () => {
|
||||
if (building) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const authUrl = `https://id.twitch.tv/oauth2/authorize` +
|
||||
`?response_type=code` +
|
||||
`&client_id=${TWITCH_APP_CLIENT_ID}` +
|
||||
@ -71,7 +76,6 @@ export const createTwitchClient = () => {
|
||||
const _access_token = getAccessToken();
|
||||
|
||||
const subscribeToFollow = async () => {
|
||||
console.log(await _access_token);
|
||||
const twitchSubResponse = await fetch(
|
||||
"https://api.twitch.tv/helix/eventsub/subscriptions",
|
||||
{
|
||||
|
Reference in New Issue
Block a user