nuxt-community / firebase-module

🔥 Easily integrate Firebase into your Nuxt project. 🔥
https://firebase.nuxtjs.org
MIT License
642 stars 97 forks source link

Provide Shortcut to AuthProviders & other Utils #10

Closed lupas closed 5 years ago

lupas commented 5 years ago

Problem

Below "util" functions are not yet accessible via nuxt-fire, so one has to import import firebase from 'firebase/app' manually where needed.

Product "Util"
Auth new firebase.auth.FacebookAuthProvider()
Auth new firebase.auth.TwitterAuthProvider()
Firestore firebase.firestore.FieldValue.serverTimestamp()
Firestore new firebase.firestore.GeoPoint()
Firestore firebase.firestore.FieldPath.documentId()

and probably many more...

Solution

Nuxt-fire could include this.$firebase as well, so the user could access these functions directly without having to import firebase/auth.

We could also include an option to toggle that: includeFirebaseApp: true

lupas commented 5 years ago

Has been fixed for the fireAuth object in #24 , which can now be accessed via $fireAuthObj. If needed for any other please let me know.

abegehr commented 5 years ago

Definitely needed for new firebase.firestore.GeoPoint() 👍

lupas commented 5 years ago

@abegehr Alright. v1.4.0 should fix that for you :)

With v.1.4.0 you can now access the objects like so:

Firebase Obj Shortcut
firebase.auth \$fireAuthObj
firebase.database \$fireDbObj
firebase.firestore \$fireStoreObj
firebase.storage \$fireStorageObj
firebase.functions \$fireFuncObj
firebase.messaging \$fireMessObj

Meaning new this.$fireStoreObj.GeoPoint() should work.