Skip to content

Instantly share code, notes, and snippets.

@artokun
Last active February 7, 2018 06:32
Show Gist options
  • Save artokun/17ef8187be063ef8e7c8c7cbcf6bb34e to your computer and use it in GitHub Desktop.
Save artokun/17ef8187be063ef8e7c8c7cbcf6bb34e to your computer and use it in GitHub Desktop.
Bind Firebase to your Vue Instance
import Vue from 'vue';
import App from './App';
import router from './router';
/* Import the firebase SDK and extend with firestore */
import firebase from 'firebase';
require('firebase/firestore');
/* Paste your firebase configuration below */
const config = {
apiKey: 'AIzaSyDNB0VRHot9Z3vxNBvxR9JDFIad2QbAY4Y',
authDomain: 'system-builder-d9645.firebaseapp.com',
databaseURL: 'https://system-builder-d9645.firebaseio.com',
projectId: 'system-builder-d9645',
storageBucket: 'system-builder-d9645.appspot.com',
messagingSenderId: '521493369838',
};
/* Initialize firebase with your configuration */
firebase.initializeApp(config);
/* Bind firebase to your Vue instance */
Vue.prototype.$firebase = firebase;
Vue.config.productionTip = false;
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>',
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment