Last active
May 29, 2018 03:04
-
-
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/
This file contains hidden or 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
// 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