diff --git a/src/lib/twitch.ts b/src/lib/twitch.ts index 4ad8ff8..b585e83 100644 --- a/src/lib/twitch.ts +++ b/src/lib/twitch.ts @@ -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", {