You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/auth.md
+33Lines changed: 33 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,39 @@ app.use(VueFire, {
20
20
21
21
This will automatically initialize and inject the [Auth module](https://firebase.google.com/docs/auth/web/start#add-initialize-sdk) as well as the other features described in this page.
22
22
23
+
Alternatively, you can also use `VueFireAuthWithDependencies()` if you want manually specify its dependencies:
24
+
25
+
```ts{14-24}
26
+
import { VueFire, VueFireAuthWithDependencies } from 'vuefire'
27
+
import {
28
+
browserLocalPersistence,
29
+
debugErrorMap,
30
+
indexedDBLocalPersistence,
31
+
prodErrorMap,
32
+
} from 'firebase/auth'
33
+
34
+
app.use(VueFire, {
35
+
firebaseApp: createFirebaseApp(),
36
+
modules: [
37
+
// ... other modules
38
+
VueFireAuthWithDependencies({
39
+
dependencies: {
40
+
errorMap:
41
+
process.env.NODE_ENV !== 'production'
42
+
? debugErrorMap
43
+
: prodErrorMap,
44
+
persistence: [
45
+
indexedDBLocalPersistence,
46
+
browserLocalPersistence,
47
+
]
48
+
}
49
+
}),
50
+
],
51
+
})
52
+
```
53
+
54
+
Doing so will allow you to use VueFire in environments other than the browser. See [Firebase Docs](https://firebase.google.com/docs/auth/web/custom-dependencies) for more information.
55
+
23
56
## Auth instance
24
57
25
58
You can access the current Auth instance in any component with the `useFirebaseAuth()` composable:
0 commit comments