-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathextension.yaml
162 lines (150 loc) · 7.35 KB
/
extension.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: firestore-revenuecat-purchases
version: 0.1.15
specVersion: v1beta # Firebase Extensions specification version (do not edit)
displayName: Enable In-App Purchases with RevenueCat
description: Facilitates in-app purchases and subscriptions, controls access to premium content, and syncs purchase information to Firestore.
license: apache-2.0
author:
authorName: RevenueCat
url: https://github.com/RevenueCat/firestore-revenuecat-purchases
sourceUrl: https://github.com/RevenueCat/firestore-revenuecat-purchases/tree/main
billingRequired: true
roles:
- role: datastore.user
reason: >-
Allows RevenueCat to store customer and event information in Cloud Firestore.
- role: firebaseauth.admin
reason: >-
Allows RevenueCat to store entitlement information in user custom claims.
resources:
- name: handler
type: firebaseextensions.v1beta.function
description: >-
Listens for RevenueCat server webhook requests, and store customer information and events in Cloud Firestore.
properties:
location: ${LOCATION}
runtime: nodejs18
httpsTrigger: {}
params:
- param: LOCATION
label: Cloud Functions location
description: >-
Where do you want to deploy the functions created for this extension?
You usually want a location close to your database. For help selecting
a location, refer to the [location selection guide](/docs/functions/locations).
type: select
options:
- label: Iowa (us-central1)
value: us-central1
- label: South Carolina (us-east1)
value: us-east1
- label: Northern Virginia (us-east4)
value: us-east4
- label: Los Angeles (us-west2)
value: us-west2
- label: Salt Lake City (us-west3)
value: us-west3
- label: Las Vegas (us-west4)
value: us-west4
- label: Warsaw (europe-central2)
value: europe-central2
- label: Belgium (europe-west1)
value: europe-west1
- label: London (europe-west2)
value: europe-west2
- label: Frankfurt (europe-west3)
value: europe-west3
- label: Zurich (europe-west6)
value: europe-west6
- label: Hong Kong (asia-east2)
value: asia-east2
- label: Tokyo (asia-northeast1)
value: asia-northeast1
- label: Osaka (asia-northeast2)
value: asia-northeast2
- label: Seoul (asia-northeast3)
value: asia-northeast3
- label: Mumbai (asia-south1)
value: asia-south1
- label: Jakarta (asia-southeast2)
value: asia-southeast2
- label: Montreal (northamerica-northeast1)
value: northamerica-northeast1
- label: Sao Paulo (southamerica-east1)
value: southamerica-east1
- label: Sydney (australia-southeast1)
value: australia-southeast1
default: us-east1
required: true
immutable: true
- param: REVENUECAT_EVENTS_COLLECTION
label: RevenueCat Webhook Events Firestore collection
description: >-
What is the path to the Cloud Firestore collection where the extension should store RevenueCat events?
Leave empty if you do not want the extension to store RevenueCat events.
(You can later modify this value in Google Firestore > Extensions > Extension Configuration > Reconfigure extension)
validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
validationErrorMessage: Firestore collection paths must be an odd number of segments separated by slashes, e.g. "path/to/collection".
required: false
- param: REVENUECAT_CUSTOMERS_COLLECTION
label: Location of the customers collection
description: >-
What is the path to the Cloud Firestore collection where the extension should store RevenueCat customer details?
This can be the location of an existing user collection, the extension will not overwrite your existing data but rather merge the RevenueCat data into your existing firestore documents.
Leave empty if you do not want the extension to store RevenueCat customer details.
It supports placeholders for app_user_id, for example:
users/{app_user_id}/purchaser-info
Will save the purchaser-info on a document named also "{app_user_id}" under the subcollection "purchaser-info"
(You can later modify this value in Google Firestore > Extensions > Extension Configuration > Reconfigure extension)
validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
validationErrorMessage: Firestore collection paths must be an odd number of segments separated by slashes, e.g. "path/to/collection".
required: false
- param: SET_CUSTOM_CLAIMS
label: Should custom claims be set in Firebase Auth with the user's active entitlements?
description: >-
Do you want to automatically update your Firebase Authentication User's custom claims with their current entitlements?
(More information: https://firebase.google.com/docs/auth/admin/custom-claims)
If set to "ENABLED", the extension will consider the app_user_id of the user to match the user's Firebase Authentication UID
and set a "Custom Claim" with their current active entitlements.
type: select
options:
- label: "ENABLED"
value: "ENABLED"
- label: "DISABLED"
value: "DISABLED"
default: "DISABLED"
required: true
- param: REVENUECAT_SHARED_SECRET
label: RevenueCat Firebase Integration Shared Secret
type: secret
description: >-
What is the webhook shared secret for the Firebase integration of your RevenueCat project?
You will find this in the RevenueCat dashboard under Projects > [your project] > Integrations > Firebase
example: my_shared_secret
validationRegex: "^.+$"
required: true
events:
- type: com.revenuecat.v1.test
description: Occurs whenever a test event issued through the RevenueCat dashboard.
- type: com.revenuecat.v1.initial_purchase
description: Occurs whenever a new subscription has been purchased.
- type: com.revenuecat.v1.non_renewing_purchase
description: Occurs whenever a customer has made a purchase that will not auto-renew.
- type: com.revenuecat.v1.renewal
description: Occurs whenever an existing subscription has been renewed. This may occur at the end of the current billing period or later if a lapsed user re-subscribes.
- type: com.revenuecat.v1.product_change
description: Occurs whenever a subscriber has changed the product of their subscription
- type: com.revenuecat.v1.cancellation
description: Occurs whenever a subscription or non-renewing purchase has been cancelled. See cancellation reasons for more details.
- type: com.revenuecat.v1.uncancellation
description: Occurs whenever an auto-renew status has been re-enabled for a subscription.
- type: com.revenuecat.v1.billing_issue
description: Occurs whenever there has been a problem trying to charge the subscriber. This does not mean the subscription has expired.
- type: com.revenuecat.v1.subscriber_alias
description: Deprecated. Occurs whenever a new app_user_id has been registered for an existing subscriber.
- type: com.revenuecat.v1.subscription_paused
description: Occurs whenever a subscription has been paused.
- type: com.revenuecat.v1.transfer
description: Occurs whenever a transfer of transactions and entitlements was initiated between one App User ID(s) to another.
- type: com.revenuecat.v1.expiration
description: Occurs whenever a subscription has expired and access should be removed.