-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathextension.yaml
188 lines (171 loc) · 8.41 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# Copyright 2021 Purchasely.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: purchasely-in-app-purchases
version: 1.0.9
specVersion: v1beta
displayName: Run In-App Purchases & Subscriptions with Purchasely
description: Quickly implement & seamlessly manage your iOS & Android In-App Purchases & In-App Subscriptions with Firebase Authentication & Firebase Firestore.
license: Apache-2.0
sourceUrl: https://github.com/Purchasely/Purchasely-Firebase-Extension
releaseNotesUrl: https://github.com/Purchasely/Purchasely-Firebase-Extension/blob/master/CHANGELOG.md
author:
authorName: Purchasely
url: https://www.purchasely.com
contributors:
- authorName: Thomas Léger
url: https://twitter.com/ElFitz_
- authorName: Firebase
url: https://firebase.google.com
billingRequired: true
roles:
- role: firebaseauth.admin
reason: >-
Allows the extension to set custom claims for users.
- role: datastore.user
reason: >-
Allows the extension to store In-App Purchases & Subscriptions in Cloud Firestore.
resources:
- name: purchaselyWebhookHandler
type: firebaseextensions.v1beta.function
description: >-
Receives the Server to Server notifications from Purchasely's webhook, validates it's signature, creates the associated Consumable, Non-Consumable or Subscription document, manages the user's Firebase Authentication Custom Claims for Subscriptions (if enabled) and creates and the raw Event document.
properties:
location: ${LOCATION}
runtime: nodejs18
httpsTrigger: {}
params:
- param: LOCATION
label: Cloud Functions deployment 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](https://firebase.google.com/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: 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-central1
required: true
immutable: true
- param: PURCHASELY_SUBSCRIPTIONS_COLLECTION
label: Users' current subscriptions Firestore collection
description: >-
What is the path to the Cloud Firestore collection where the extension should store your current users' subscriptions?
default: PurchaselySubscriptions
validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
validationErrorMessage: Firestore collection paths must be an odd number of segments separated by slashes, e.g. "path/to/collection".
required: true
- param: PURCHASELY_CONSUMABLES_COLLECTION
label: Users' purchased Consumables Firestore collection
description: >-
What is the path to the Cloud Firestore collection where the extension should store your current users' consumables?
default: PurchaselyConsumables
validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
validationErrorMessage: Firestore collection paths must be an odd number of segments separated by slashes, e.g. "path/to/collection".
required: true
- param: PURCHASELY_NON_CONSUMABLES_COLLECTION
label: Users' Purchased Non Consumables Firestore collection
description: >-
What is the path to the Cloud Firestore collection where the extension should store your current users' non consumables?
default: PurchaselyNonConsumables
validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
validationErrorMessage: Firestore collection paths must be an odd number of segments separated by slashes, e.g. "path/to/collection".
required: true
- param: PURCHASELY_EVENTS_COLLECTION_2
label: Purchasely Webhook Raw Events Firestore collection (for legacy, aka v2, events format)
description: >-
What is the path to the Cloud Firestore collection where the extension should store the raw legacy events coming from the Purchasely webhook?
This should be a new collection that the extension will create when receiving the first events.
Leave this field empty if you do not want the extension to save the raw Purchasely Legacy Events.
default: PurchaselyEvents
validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
validationErrorMessage: Firestore collection paths must be an odd number of segments separated by slashes, e.g. "path/to/collection".
required: false
- param: PURCHASELY_EVENTS_COLLECTION_3
label: Purchasely Webhook Raw Events Firestore collection (current events format)
description: >-
What is the path to the Cloud Firestore collection where the extension should store the raw events coming from the Purchasely webhook?
This should be a new collection that the extension will create when receiving the first events.
Leave this field empty if you do not want the extension to save the raw Purchasely Events.
default: PurchaselyEvents_3
validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
validationErrorMessage: Firestore collection paths must be an odd number of segments separated by slashes, e.g. "path/to/collection".
required: false
- param: UPDATE_FIREBASE_AUTH_CUSTOM_CLAIMS
label: Update Firebase Authentication Users' custom claims with current subscriptions
description: >-
Do you want to automatically update your Firebase Authentication User's custom claims
(see https://firebase.google.com/docs/auth/admin/custom-claims) with their current subscriptions?
If set to "ENABLED", the extension will consider the Webhook event's user's vendor id to match the user's Firebase Authentication UID
and attempt to update said user's Custom Claims with their current subscriptions' status.
If set to "DISABLED" (default), the extension will NOT set & update the user's subscriptions in the user's Firebase Authentication Custom Claims.
If you do not use Firebase Authentication for your app or do not setup the Purchasely User Id in your app
(see https://docs.purchasely.com/quick-start/sdk-configuration) to match with the UID provided for your user by Firebase,
leave this option to "DISABLED".
type: select
options:
- label: "ENABLED"
value: "ENABLED"
- label: "DISABLED"
value: "DISABLED"
default: "DISABLED"
required: true
- param: PURCHASELY_SHARED_SECRET
label: Purchasely Client Webhook Shared Secret
description: >-
What is your Purchasely Client Webhook shared secret?
To validate and authenticate incoming webhook requests, the extension needs to verify their signature
(see https://docs.purchasely.com/quick-start/webhook-1/detailed-specification#request).
It can be found or setup in your Purchasely Console (Client shared secret)
Purchasely Console > Applications > [YOUR APP] > App Settings > Backend & SDK Configuration
example: a_shared_secret
validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
required: true