Skip to content

Instantly share code, notes, and snippets.

@mjgartendev
Last active May 29, 2018 03:04
Show Gist options
  • Save mjgartendev/a1001beb9e189126b33d9e8449e848f8 to your computer and use it in GitHub Desktop.
Save mjgartendev/a1001beb9e189126b33d9e8449e848f8 to your computer and use it in GitHub Desktop.
Template to add firebase connection settings to vue project from https://www.smashingmagazine.com/2018/04/vuejs-firebase-firestore/
// Copied/simplified from https://www.smashingmagazine.com/2018/04/vuejs-firebase-firestore/
// by https://www.smashingmagazine.com/author/lukas-van-driel
// 1. npm install firebase
// 2. insert this snippet in your Vuex root
import Vue from 'vue';
import firebase from 'firebase/app';
import 'firebase/firestore';
// Copy this from the cloud console "add to web app" settings
var config = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: ""
};
firebase.initializeApp(config);
// The shared state object that any vue component can get access to.
export const store = {
currentUser: null
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment