Skip to content

Commit 5ecbae0

Browse files
committed
docs: ssrKey notes
1 parent 1d46371 commit 5ecbae0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/guide/ssr.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,24 @@ const { data: users } = useUserList()
165165
```
166166
167167
-->
168+
169+
## Manual SSR keys
170+
171+
VueFire automatically infers an SSR key based on the path of the document or collection whenever possible. This means there are some scenarios where **you have to provide a manual `ssrKey`**:
172+
173+
- When using Firestore Queries
174+
- When binding the same document multiple times
175+
176+
In these scenarios, provide the `ssrKey` as a second argument to `useDocument()`, `useCollection()`, etc:
177+
178+
<FirebaseExample>
179+
180+
```ts
181+
useDatabaseList(queryRef, { ssrKey: 'my-quiz' })
182+
```
183+
184+
```ts
185+
useCollection(queryRef, { ssrKey: 'my-quiz' })
186+
```
187+
188+
</FirebaseExample>

0 commit comments

Comments
 (0)