Skip to content

Commit dc95689

Browse files
committed
Added some basic POSTINSTALL instructions
1 parent c19dabc commit dc95689

File tree

1 file changed

+52
-8
lines changed

1 file changed

+52
-8
lines changed

POSTINSTALL.md

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,64 @@ Learn more about writing a POSTINSTALL.md file in the docs:
1010
https://firebase.google.com/docs/extensions/publishers/user-documentation#writing-postinstall
1111
-->
1212

13-
# See it in action
13+
#### Set your Cloud Firestore rules
1414

15-
You can test out this extension right away!
15+
Set up your security roles so that only authenticated users can access support messages, and that each user can only access their own messages.
1616

17-
Visit the following URL:
18-
${function:greetTheWorld.url}
17+
```
18+
rules_version = '2';
19+
service cloud.firestore {
20+
match /databases/{database}/documents {
21+
match /${param:MESSAGES_PATH}/{id} {
22+
allow read, create: if request.auth != null && request.auth.uid == userId;
23+
allow update, delete: if false;
24+
}
25+
}
26+
}
27+
```
1928

20-
# Using the extension
29+
#### Set your Cloud Firestore indexes
2130

22-
When triggered by an HTTP request, this extension responds with the following specified greeting: "${param:GREETING} World from ${param:EXT_INSTANCE_ID}".
31+
Create this `fieldOverride` within `firestore.indexes.json`:
32+
```
33+
{
34+
"indexes": [...],
35+
"fieldOverrides": [
36+
{
37+
"collectionGroup": "support",
38+
"fieldPath": "slackThreadTs",
39+
"ttl": false,
40+
"indexes": [
41+
{
42+
"order": "ASCENDING",
43+
"queryScope": "COLLECTION"
44+
},
45+
{
46+
"order": "DESCENDING",
47+
"queryScope": "COLLECTION"
48+
},
49+
{
50+
"arrayConfig": "CONTAINS",
51+
"queryScope": "COLLECTION"
52+
},
53+
{
54+
"order": "ASCENDING",
55+
"queryScope": "COLLECTION_GROUP"
56+
}
57+
]
58+
}
59+
]
60+
}
61+
```
2362

24-
To learn more about HTTP functions, visit the [functions documentation](https://firebase.google.com/docs/functions/http-events).
63+
#### Configure the Firebase Integration in the Slack App
64+
65+
Log in to your [Slack Apps](https://api.slack.com/apps/), select your app in the dropdown, then go to Features -> Event Subscriptions. After enabling the events, in the field **Request URL**, enter the following value:
66+
```
67+
${function:handler.url}
68+
```
2569

2670
<!-- We recommend keeping the following section to explain how to monitor extensions with Firebase -->
27-
# Monitoring
71+
#### Monitoring
2872

2973
As a best practice, you can [monitor the activity](https://firebase.google.com/docs/extensions/manage-installed-extensions#monitor) of your installed extension, including checks on its health, usage, and logs.

0 commit comments

Comments
 (0)