Skip to content

Commit

Permalink
fix: prefix client env var with NEXT_PUBLIC
Browse files Browse the repository at this point in the history
  • Loading branch information
jeferson-sb committed Jan 6, 2024
1 parent 284f6ac commit ea452e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/env/env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})

/**
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/lib/oneSignal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});

Expand Down

1 comment on commit ea452e9

@vercel
Copy link

@vercel vercel bot commented on ea452e9 Jan 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

whatconf – ./

whatconf.vercel.app
whatconf-jeferson-sb.vercel.app
whatconf-git-main-jeferson-sb.vercel.app

Please sign in to comment.