Skip to content

Commit 6a4522f

Browse files
committed
docs: nuxt install
1 parent b81dff0 commit 6a4522f

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

docs/nuxt/getting-started.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@
44
The Nuxt module and this docs are a WIP. Things might not work yet.
55
:::
66

7-
Install
7+
## Installation
88

99
```bash
1010
npm install nuxt-vuefire
1111
```
1212

13-
Add it to your nuxt config:
13+
Additionally, if you are using [SSR](https://nuxt.com/docs/api/configuration/nuxt-config/#ssr), you need to install `firebase-admin` and some other peer dependencies:
14+
15+
```bash
16+
npm install firebase-admin @firebase/@app-types
17+
```
18+
19+
## Configuration
20+
21+
Next, add `nuxt-vuefire` to the `modules` section of `nuxt.config.js` and configure it with the credentials created in your app settings in your project overview (`https://console.firebase.google.com/project/YOUR_PROJECT_NAME/overview)`. You can find more details [in Firebase Documentation](https://firebase.google.com/docs/web/setup#create-project). It should look something like this:
1422

1523
```ts
1624
export default defineNuxtConfig({
@@ -20,7 +28,30 @@ export default defineNuxtConfig({
2028
],
2129

2230
vuefire: {
23-
/* options */
31+
config: {
32+
apiKey: '...',
33+
authDomain: '...',
34+
projectId: '...',
35+
appId: '...',
36+
// there could be other properties depending on the project
37+
},
2438
},
2539
})
2640
```
41+
42+
If you are using SSR with any auth related feature, you will need to create a [service account](https://firebase.google.com/support/guides/service-accounts) and provide a path to the credentials file in the `serviceAccount` property:
43+
44+
```ts
45+
export default defineNuxtConfig({
46+
vuefire: {
47+
// ...
48+
admin: {
49+
serviceAccount: 'path/to/credentials.json',
50+
}
51+
},
52+
})
53+
```
54+
55+
:::tip
56+
This service account file contains sensitive information and should **not be committed to your repository**.
57+
:::

0 commit comments

Comments
 (0)