Skip to content

Instantly share code, notes, and snippets.

@sconstantinides
Created May 1, 2018 23:23
Show Gist options
  • Save sconstantinides/546a48ba183b1234f750ca6261440199 to your computer and use it in GitHub Desktop.
Save sconstantinides/546a48ba183b1234f750ca6261440199 to your computer and use it in GitHub Desktop.
Sample Firebase config
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