Integrate Firestore database
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { initializeApp } from 'firebase/app'
|
||||
import { getAuth } from 'firebase/auth'
|
||||
import { getFirestore } from 'firebase/firestore'
|
||||
|
||||
// Firebase configuration
|
||||
const firebaseConfig = {
|
||||
@@ -17,8 +18,12 @@ const app = initializeApp(firebaseConfig)
|
||||
// Initialize Firebase Authentication and get a reference to the service
|
||||
const auth = getAuth(app)
|
||||
|
||||
// Initialize Cloud Firestore and get a reference to the service
|
||||
const db = getFirestore(app)
|
||||
|
||||
export default ({ app }, inject) => {
|
||||
// Inject $auth in Vue, context and store.
|
||||
// Inject $auth and $db in Vue, context and store.
|
||||
// Ref: https://nuxtjs.org/docs/directory-structure/plugins/
|
||||
inject('auth', auth)
|
||||
inject('db', db)
|
||||
}
|
||||
Reference in New Issue
Block a user