Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
74 views

Firebase API key is not defined error in Next.js project using Firebase SDK

I'm setting up Firebase (version 10.x) in my Next.js (version) 14 app, but I'm encountering the following error when trying to initialize Firebase: Firebase API key is not defined. Ensure ...
Akhlaq Ahmad's user avatar
1 vote
0 answers
76 views

How to make environment variables private with Next.js apps hosted on Firebase App Hosting

I'm talking about Firebase App Hosting. Not Firebase Hosting. Inside apphosting.yaml, I reference secrets managed by Google Secret Manager. If I simply do this: env: - variable: MY_SECRET ...
Félix Paradis's user avatar
1 vote
1 answer
1k views

Environment Variables with Firebase Config and Next.js

I'm trying to use a .env with Next.js and Firebase config. When I use the variable itself it works normally but when I add it on the .env and use it on the config it doesn't work anymore. import { ...
Kobra's user avatar
  • 1,366
2 votes
1 answer
3k views

How can I access environment variables from a file sitting inside the public folder in Next.js?

I'm integrating Firebase Cloud Messaging, and it is required to have firebase-messaging-sw.js file inside the public folder as a service worker. The file needs to have my firebase config, which I of ...
Tsabary's user avatar
  • 4,008
0 votes
1 answer
1k views

Hiding API keys with Firebase without rendering in the client side? [duplicate]

I'm looking for a secure way to handle API keys in my NextJS web app using Firebase. I see the suggestion to "hide" the keys in an ENV file then make sure of the variables by calling ...
engineer-x's user avatar
  • 3,245
0 votes
1 answer
384 views

Firebase config breaks when `projectId` is from environment variable

I'm experiencing a really odd issue with my Firebase config object and Vercel environment variables. I can build up my entire Firebase config object with Vercel environment variables but if I use an ...
pinglock's user avatar
  • 1,301
1 vote
2 answers
404 views

Why NEXTAUTH_URL in .env file ignored after firebase deploy?

I use next-auth to made a session, and deploy with firebase. In local, I confirmed next-auth basepath changed,. But after deploy, next-auth basepath don't changed. The basepath is always "https://...
judy's user avatar
  • 117
0 votes
1 answer
1k views

How to hide firebase-admin credentials in Next Js

So I am using firebase-admin in Next Js. I used environment variables but can't hide the firebase service account keys because they are not defined in server-side on Next JS. So i had to use ...
Pritam Upadhya's user avatar
0 votes
1 answer
2k views

How can I securely hide api keys that need to be accessed by the client in Nextjs?

I am developing a web application using NextJS. I am using firebase, sentry.io and infinite scroll in my project. When the application first runs, my data from the backend comes as server side. If the ...
Caner's user avatar
  • 796
-1 votes
1 answer
408 views

env.local vs String var

I'm getting access denied error by firebase. I noticed that this error occurs when in the "configs.ts" file of the backend, when I pass the value of the "project_ID" by the ...
Tiago Oliveira Gomes's user avatar
3 votes
1 answer
4k views

How can I tell firebase if I'm in development or production? (For firebase functions sandbox/live switch)

I have some firebase functions that I test locally, but I really don't want to have to rely on remembering to switch a flag, or explicitly set the values. Is there a value I can check in firebase to ...
Joel Hager's user avatar
  • 3,448