Skip to content

Commit 0075d99

Browse files
committed
docs: note about VueFireAuthWithDependencies()
1 parent 739110c commit 0075d99

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

docs/guide/auth.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,39 @@ app.use(VueFire, {
2020

2121
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.
2222

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+
2356
## Auth instance
2457

2558
You can access the current Auth instance in any component with the `useFirebaseAuth()` composable:

0 commit comments

Comments
 (0)