Vercel and firebase private key issue #417
-
HI all, wanted to ask So basically I'd need to set the config for firebaseAdminInitConfig server side as part of a /api/route or similar. To avoid the following message: "Error: Invalid next-firebase-auth options: The "firebaseAdminInitConfig" private key setting should not be available on the client side." Feedback appreciated! This is the config: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
When validating whether the private key is set or not set, this library only cares about the following:
Though the config is initialized in the same code for the server and client, it can (and should) contain different values. It seems like the difficult part in your case is fetching the private key value prior to loading the app. You might approach this with middleware or a higher-order function that gets the private key server-side and passes it to the composed function that initializes |
Beta Was this translation helpful? Give feedback.
When validating whether the private key is set or not set, this library only cares about the following:
Though the config is initialized in the same code for the server and client, it can (and should) contain different values.
It seems like the difficult part in your case is fetching the private key value prior to loading the app. You might approach this with middleware or a higher-order function that gets the private key server-side and passes it to the composed function that initializes
next-firebase-auth
.