|
|
|
@ -2,15 +2,15 @@ import * as firebase from 'firebase/app'
|
|
|
|
|
import 'firebase/auth'
|
|
|
|
|
|
|
|
|
|
if (firebase.apps.length === 0) {
|
|
|
|
|
if (process.env.FIREBASE_API_KEY && process.env.FIREBASE_FE_APP_ID) {
|
|
|
|
|
if (process.env.NEXT_PUBLIC_FIREBASE_API_KEY && process.env.NEXT_PUBLIC_FIREBASE_FE_APP_ID) {
|
|
|
|
|
firebase.initializeApp({
|
|
|
|
|
apiKey: process.env.FIREBASE_API_KEY,
|
|
|
|
|
authDomain: `${process.env.FIREBASE_PROJECT_ID}.firebaseapp.com`,
|
|
|
|
|
databaseURL: `https://${process.env.FIREBASE_PROJECT_ID}.firebaseio.com`,
|
|
|
|
|
projectId: process.env.FIREBASE_PROJECT_ID,
|
|
|
|
|
storageBucket: `${process.env.FIREBASE_PROJECT_ID}.appspot.com`,
|
|
|
|
|
messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,
|
|
|
|
|
appId: process.env.FIREBASE_FE_APP_ID,
|
|
|
|
|
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
|
|
|
|
|
authDomain: `${process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID}.firebaseapp.com`,
|
|
|
|
|
databaseURL: `https://${process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID}.firebaseio.com`,
|
|
|
|
|
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
|
|
|
|
|
storageBucket: `${process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID}.appspot.com`,
|
|
|
|
|
messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
|
|
|
|
|
appId: process.env.NEXT_PUBLIC_FIREBASE_FE_APP_ID,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|