Last active
November 20, 2019 03:18
-
-
Save standinga/2611a68fc46d196000c3c478ff548a81 to your computer and use it in GitHub Desktop.
firebase.js plugin for the medium post about configuring google-sign in with vue, nuxt, firebase
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
import firebase from 'firebase' | |
// copy the config from the console https://console.firebase.google.com/u/0/project/sign-11111/settings/general/ | |
var firebaseConfig = { | |
apiKey: "AI1111111111111111111111111111", | |
authDomain: "sign-1111111.firebaseapp.com", | |
databaseURL: "https://sign-11111.firebaseio.com", | |
projectId: "sign-11111", | |
storageBucket: "sign-11111.appspot.com", | |
messagingSenderId: "111111111111", | |
appId: "1:1111111:web:111111111111111" | |
}; | |
let app = null | |
// prevent initializing firebase more than once | |
if (!firebase.apps.length) { | |
app = firebase.initializeApp(firebaseConfig) | |
} | |
// inject it so it can be accessed as this.$firebase inside the project | |
export default (ctx, inject) => { | |
inject('firebase', firebase) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment