Created
May 1, 2018 23:23
-
-
Save sconstantinides/546a48ba183b1234f750ca6261440199 to your computer and use it in GitHub Desktop.
Sample Firebase config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import firebase from '@firebase/app'; | |
import '@firebase/firestore'; | |
firebase.initializeApp({ | |
apiKey: 'YOUR_API_KEY', | |
// Configure the above client key at https://console.cloud.google.com/apis/credentials | |
// Restrict to: *.your-domain.com/* (and localhost for testing) | |
// Restrict to: Google Cloud Firestore API, Identity Toolkit API | |
authDomain: 'your-app.firebaseapp.com', | |
projectId: 'your-app' | |
}); | |
firebase.firestore().settings({ timestampsInSnapshots: true }); | |
export default firebase.firestore().enablePersistence() | |
.then(() => firebase.firestore()) | |
.catch(error => firebase.firestore()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment