diff --git a/src/env/env.mjs b/src/env/env.mjs index 45a0bd8..0393e88 100644 --- a/src/env/env.mjs +++ b/src/env/env.mjs @@ -31,8 +31,8 @@ const server = z.object({ * built with invalid env vars. To expose them to the client, prefix them with `NEXT_PUBLIC_`. */ const client = z.object({ - ONESIGNAL_APP_ID: z.string(), - ONESIGNAL_SAFARI_ID: z.string() + NEXT_PUBLIC_ONESIGNAL_APP_ID: z.string(), + NEXT_PUBLIC_ONESIGNAL_SAFARI_ID: z.string() }) /** @@ -52,8 +52,8 @@ const processEnv = { GOOGLE_CLIENT_SECRET: process.env.GOOGLE_CLIENT_SECRET, NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET, NEXTAUTH_URL: process.env.NEXTAUTH_URL, - ONESIGNAL_APP_ID: process.env.ONESIGNAL_APP_ID, - ONESIGNAL_SAFARI_ID: process.env.ONESIGNAL_SAFARI_ID + NEXT_PUBLIC_ONESIGNAL_APP_ID: process.env.NEXT_PUBLIC_ONESIGNAL_APP_ID, + NEXT_PUBLIC_ONESIGNAL_SAFARI_ID: process.env.NEXT_PUBLIC_ONESIGNAL_SAFARI_ID } // Don't touch the part below diff --git a/src/lib/oneSignal.ts b/src/lib/oneSignal.ts index 58bfc00..63728b6 100644 --- a/src/lib/oneSignal.ts +++ b/src/lib/oneSignal.ts @@ -8,8 +8,8 @@ export const initializeOneSignal = async ( ) => { try { await OneSignal.init({ - appId: env.ONESIGNAL_APP_ID, - safari_web_id: env.ONESIGNAL_SAFARI_ID, + appId: env.NEXT_PUBLIC_ONESIGNAL_APP_ID, + safari_web_id: env.NEXT_PUBLIC_ONESIGNAL_SAFARI_ID, allowLocalhostAsSecureOrigin: true, });