erdkse / adminlte-3-react

React 18.3.1 start-up project with AdminLTE 3.2.0 template
https://erdkse.com/projects/preview/adminlte-react
MIT License
256 stars 133 forks source link

Firebase: how to specify the Firebase environment correctly? #97

Closed stevennt closed 2 months ago

stevennt commented 2 months ago

Hi, how to specify the Firebase config in the production correctly? I tried to put the below in but did not work. Tks.

image image

The firebase config like this:

image

VITE_NODE_ENV=production VITE_FIREBASE_CONFIG={ apiKey: "===============", authDomain: "=====saas.firebaseapp.com", projectId: "====-saas", storageBucket: "=======-saas.appspot.com", messagingSenderId: "=====", appId: "1:=====:web:4d222293978711fc8d96ea", measurementId: "G-P======" };

erdkse commented 2 months ago

Hey @stevennt , It should be one line stringfied JSON. You can use JSON.stringfy(FIREBASE_CONFIG) and paste it in .env file.

stevennt commented 2 months ago

Works like a charm. Thanks!