Skip to content

Instantly share code, notes, and snippets.

@Eder87rh
Created March 30, 2019 15:47
Show Gist options
  • Select an option

  • Save Eder87rh/69730982fbc9e9151b1a0e85887bf470 to your computer and use it in GitHub Desktop.

Select an option

Save Eder87rh/69730982fbc9e9151b1a0e85887bf470 to your computer and use it in GitHub Desktop.
5 - cropchien - configFirebase.js
import firebase from 'firebase/app'
import 'firebase/firestore';
import 'firebase/messaging';
import 'firebase/storage';
const config = {
apiKey: "####",
authDomain: "####",
databaseURL: "####",
projectId: "####",
storageBucket: "####",
messagingSenderId: "####"
}
firebase.initializeApp(config)
// Initialize Cloud Firestore through Firebase
let db = firebase.firestore();
// Disable deprecated features
db.settings({
timestampsInSnapshots: true
});
db.enablePersistence({experimentalTabSynchronization:true})
const storage = firebase.storage()
const messaging = firebase.messaging()
export default {
db,
storage,
messaging
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment