Skip to content

Instantly share code, notes, and snippets.

@thaleshcv
Last active September 19, 2018 14:15
Show Gist options
  • Save thaleshcv/8c99d65b583920798354c2558d19d7e7 to your computer and use it in GitHub Desktop.
Save thaleshcv/8c99d65b583920798354c2558d19d7e7 to your computer and use it in GitHub Desktop.
firebase initialization
import firebase from 'firebase/app';
import 'firebase/auth';
import 'firebase/database';
// Initialize Firebase
const config = {
apiKey: process.env.REACT_APP_APIKEY,
authDomain: process.env.REACT_APP_AUTHDOMAIN,
databaseURL: process.env.REACT_APP_DATABASEURL,
projectId: process.env.REACT_APP_PROJECTID,
storageBucket: process.env.REACT_APP_STORAGEBUCKET,
messagingSenderId: process.env.REACT_APP_MESSAGINGSENDERID
};
if (firebase.apps.length === 0) {
firebase.initializeApp(config);
}
export default firebase;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment