You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/activities/Building_An_Activity.mdx
+18-19Lines changed: 18 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
sidebar_label: Building an Activity
2
+
sidebar_label: Quickstart
3
3
---
4
4
5
5
# Building Your First Activity in Discord
@@ -134,22 +134,6 @@ Details about installation contexts is in the [Application documentation](#DOCS_
134
134
135
135
Click on **Installation** in the left sidebar, then under **Installation Contexts** make sure both "User Install" and "Guild Install" are selected. This will make sure users can launch our app's Activity across Discord servers, DMs, and Group DMs.
136
136
137
-
### Enable Activities
138
-
139
-
Next, we'll need to enable Activities for your app. On the left hand sidebar under **Activities**, click **Getting Started**.
140
-
141
-
Review this page and press **Enable**.
142
-
143
-

144
-
145
-
After enabling Activities, you'll see the different Activity-related pages in your app's settings under the **Activities** section. Across these pages, you'll be able to update information like supported platforms, upload assets, and configure Activity-specific settings. We'll come back to this section later in the guide to set up URL mappings.
146
-
147
-
#### Default Entry Point Command
148
-
149
-
When you enable Activities for your app, a [default Entry Point command](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/default-entry-point-command) called "Launch" is automatically created. This [Entry Point command](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/entry-point-commands) is the primary way for users to launch your Activity in Discord.
150
-
151
-
By default, interactions with this command will result in Discord opening your Activity for the user and posting a message in the channel where it was launched from. However, if you prefer to handle the interactions in your app, you can update the [`handler` field](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/entry-point-handlers) or create your own. Additional details are in the Entry Point command [documentation](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/entry-point-commands) and [development guide](#DOCS_ACTIVITIES_DEVELOPMENT_GUIDES/setting-up-an-entry-point-command).
152
-
153
137
### Add a Redirect URI
154
138
155
139
Next, we'll add a Redirect URI, which is where a user is typically redirected to after authorizing with your app when going through the standard OAuth flow. While setting up a Redirect URI is required, the Embedded App SDK automatically handles redirecting users back to your Activity when the RPC [`authorize` command](#DOCS_DEVELOPER_TOOLS_EMBEDDED_APP_SDK/authorize) is called.
@@ -187,7 +171,6 @@ Back in your app's settings, click on **OAuth2** on the sidebar:
- Added your app's Client ID and Client Secret to your project's `.env` file.
193
176
</Collapsible>
@@ -266,7 +249,7 @@ By the end of Step 3, make sure you have:
266
249
267
250
## Step 4: Running your app in Discord
268
251
269
-
Let's ensure everything is wired up correctly, then run the Activity in Discord.
252
+
Let's ensure everything is wired up correctly, enable activities via the dev portal, and then run the Activity in Discord.
270
253
271
254
### Run your app
272
255
@@ -322,6 +305,21 @@ Back in your app's settings, click on the **URL Mappings** page under **Activiti
322
305
323
306
Read details about URL Mapping [in the development guide](#DOCS_ACTIVITIES_DEVELOPMENT_GUIDES/url-mapping).
324
307
308
+
### Enable Activities
309
+
310
+
Next, we'll need to enable Activities for your app. On the left hand sidebar under **Activities**, click **Settings**.
311
+
312
+
Find the first checkbox, labeled `Enable Activities`. Turn it on 🎉
313
+
314
+

315
+
316
+
#### Default Entry Point Command
317
+
318
+
When you enable Activities for your app, a [default Entry Point command](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/default-entry-point-command) called "Launch" is automatically created. This [Entry Point command](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/entry-point-commands) is the primary way for users to launch your Activity in Discord.
319
+
320
+
By default, interactions with this command will result in Discord opening your Activity for the user and posting a message in the channel where it was launched from. However, if you prefer to handle the interactions in your app, you can update the [`handler` field](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/entry-point-handlers) or create your own. Additional details are in the Entry Point command [documentation](#DOCS_INTERACTIONS_APPLICATION_COMMANDS/entry-point-commands) and [development guide](#DOCS_ACTIVITIES_DEVELOPMENT_GUIDES/setting-up-an-entry-point-command).
321
+
322
+
325
323
### Running your Activity in Discord
326
324
327
325
Now that we are pointing Discord to our locally running app, we can launch the Activity in Discord!
@@ -342,6 +340,7 @@ We're looking pretty good so far, but we haven't wired up any Discord functional
342
340
By the end of Step 4, make sure you have:
343
341
- Set up a public endpoint
344
342
- Added an Activity URL Mapping in your app's settings
Copy file name to clipboardExpand all lines: docs/activities/Development_Guides.mdx
-3Lines changed: 0 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -209,9 +209,6 @@ Because your application is "sandboxed", it will be unable to make network reque
209
209
210
210
#### How to set a URL Mapping
211
211
212
-
> preview
213
-
> This is only possible once Activities are enabled on your application.
214
-
215
212
To add or modify your application's URL mappings, click on `Activities -> URL Mappings` and set the prefix and target values for each mapping as needed.
216
213
217
214

Copy file name to clipboardExpand all lines: docs/change_log/2024-08-28-subscription-api-and-entitlement-migration.md
+11-7Lines changed: 11 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,17 @@ topics:
6
6
breaking: true
7
7
---
8
8
9
+
> info
10
+
> Updates to this Change Log entry was published on **October 7, 2024** to reflect up-to-date information. See the [new Change Log entry](#DOCS_CHANGE_LOG/updates-to-entitlement-migration-guide) for details on updates.
11
+
9
12
We are migrating our entitlement system to a new behavior where entitlements will not end until explicitly canceled, representing a breaking change for subscription management. We are introducing a [Subscription API](#DOCS_RESOURCES_SUBSCRIPTION) and [Subscription Events](#DOCS_TOPICS_GATEWAY_EVENTS/subscriptions) to allow handling subscription-related events.
10
13
11
14
> warn
12
15
> This change will be rolled out to all existing applications that have entitlements for user and guild subscription SKUs, starting on October 1, 2024.
13
16
14
17
#### Entitlement Migration Details
15
18
-`ENTITLEMENT_CREATE` events will now be triggered with a null `ends_at` value for all ongoing subscriptions, indicating an indefinite entitlement.
16
-
-`ENTITLEMENT_UPDATE` events will occur only when a subscription is canceled, with the `ends_at` value indicating the end date.
19
+
-`ENTITLEMENT_UPDATE` events will occur only when a subscription ends, with the `ends_at` value indicating the end date.
17
20
- Discord-managed Subscription entitlements will have an `type` value of `PURCHASE` (type `1`) instead of `APPLICATION_SUBSCRIPTION` (type `8`).
18
21
19
22
### Migration Plan & Guide:
@@ -56,7 +59,7 @@ Post-migration, entitlements for Subscription SKUs purchased through Discord wil
56
59
### Migration Timeline
57
60
58
61
-**Migration Start Date:** October 1, 2024
59
-
-**Migration End Date:**October 31, 2024
62
+
-**Migration End Date:**November 1, 2024
60
63
61
64
### Migration Impacts
62
65
@@ -65,7 +68,8 @@ Post-migration, entitlements for Subscription SKUs purchased through Discord wil
65
68
-**During Migration Window:**
66
69
- These will automatically transfer to the new system.
67
70
- A new `ENTITLEMENT_CREATE` event will be triggered to indicate the migration. This does not indicate a net new entitlement.
68
-
- No further events will be generated until cancellation, which will then trigger an `ENTITLEMENT_UPDATE` event.
71
+
- No further events will be generated until the entitlement ends, which will then trigger an `ENTITLEMENT_UPDATE` event.
72
+
- The `ends_at` value in the `ENTITLEMENT_UPDATE` event and in the Entitlement API will indicate the timestamp when the entitlement ends.
69
73
70
74
### 2) Existing Entitlements Set to End
71
75
@@ -79,12 +83,12 @@ Post-migration, entitlements for Subscription SKUs purchased through Discord wil
79
83
- Adjust your system to handle `ends_at` being null, which now indicates an indefinite entitlement.
80
84
- Adjust your system not to expect type `APPLICATION_SUBSCRIPTION` (type `8`) for Discord-managed subscription entitlements.
81
85
-**Post-Migration:**
82
-
- Monitor for `ENTITLEMENT_CREATE`and `ENTITLEMENT_UPDATE` events.
83
-
- Update your handling of `ends_at` timestampsto manage cancellations effectively.
86
+
- Monitor for `ENTITLEMENT_CREATE`, `ENTITLEMENT_UPDATE`, `SUBSCRIPTION_CREATE`, and `SUBSCRIPTION_UPDATE` events.
87
+
- Update any references to an entitlement `ends_at` timestamps, which now indicate the ending of an entitlement. If you need to know when a subscription's period ends, use the [Subscription API](#DOCS_RESOURCES_SUBSCRIPTION) and related [Subscription Gateway Events](#DOCS_TOPICS_GATEWAY_EVENTS/subscriptions).
84
88
85
89
<Collapsibletitle="Entitlement Migration Example Scenario"description="Step-by-step example of an entitlement upgrading to the new entitlement system"icon="view"open>
86
90
- The Entitlement Migration begins on October 1, 2024
87
91
- You have an existing user subscription that has an existing `ends_at` timestamp for October 10, 2024.
88
-
- If the subscription renews successfully, you will receive an `ENTITLEMENT_UPDATE` event on October 10, 2024, with an `ends_at` value of null
89
-
- If you receive an `ENTITLEMENT_UPDATE` event with an `ends_at` timestamp, the entitlement for this subscription is expected to end at the timestamp value unless you receive subsequent `ENTITLEMENT_UPDATE` events between the cancellation and the `ends_at` value.
92
+
- If the subscription renews successfully, you will receive an `ENTITLEMENT_CREATE` event on October 10, 2024, with an `ends_at` value of null
93
+
-~~If you receive an `ENTITLEMENT_UPDATE` event with an `ends_at` timestamp, the entitlement for this subscription is expected to end at the timestamp value unless you receive subsequent `ENTITLEMENT_UPDATE` events between the cancellation and the `ends_at` value.~~
The entitlement migration started on **October 1, 2024** and will continue through 11:59PM PST on **November 1, 2024**.
9
+
10
+
We updated our previous entitlement migration guide to provide more up-to-date information on impacts of developer impacts. Here's a summary of the changes we made:
11
+
12
+
- The migration will run through November 1, 2024 to ensure that any entitlements that are set to renew in October will be properly migrated to the new entitlement system upon renewal.
13
+
-`ENTITLEMENT_UPDATE` events will only occur when a subscription ends.
14
+
- The value of the `ends_at` in `ENTITLEMENT_UPDATE` events indicate the timestamp for **when the entitlement is no longer valid**.
15
+
- The `ends_at` value on the [entitlement object](#DOCS_RESOURCES_ENTITLEMENT/entitlement-object) is set when the subscription ends.
16
+
- To receive the value of when a subscription was canceled, you should listen for the `SUBSCRIPTION_UPDATE` events or use the [Subscription API](#DOCS_RESOURCES_SUBSCRIPTION).
17
+
18
+
View the [updated migration guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration).
19
+
20
+
To see a full diff of the changes, refer to this pull request: [Entitlement Migration Guide Updates](https://github.com/discord/discord-api-docs/pull/7201).
Copy file name to clipboardExpand all lines: docs/monetization/Implementing_App_Subscriptions.mdx
+30-8Lines changed: 30 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ When creating subscriptions, you will need to choose between user or guild subsc
19
19
## How App Subscriptions Work
20
20
21
21
> danger
22
-
> **Starting on October 1st, 2024**, the`ENTITLEMENT_CREATE` and `ENTITLEMENT_UPDATE` event behavior is changing. Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration) for more information on what is changing and how to prepare.
22
+
> **Starting on October 1st, 2024**, the`ENTITLEMENT_CREATE` and `ENTITLEMENT_UPDATE` event behavior described below is changing. Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration) for more information on what is changing and how to prepare.
23
23
24
24
- When a user purchases your subscription SKU, Discord creates an [Entitlement](#DOCS_RESOURCES_ENTITLEMENT) for the user (or guild) and that specific Subscription [SKU](#DOCS_RESOURCES_SKU).
25
25
- You will receive an `ENTITLEMENT_CREATE` event via the Gateway.
@@ -36,10 +36,30 @@ When creating subscriptions, you will need to choose between user or guild subsc
36
36
- This entitlement will be available on `Interaction Payloads` initiated from the entitled user or users in a guild (for guild subscriptions).
37
37
- This subscription will be available via the `LIST Subscriptions` API endpoint.
38
38
- This entitlement is granted indefinitely until the user decides to cancel their subscription. `ends_at` will be null.
39
-
- When a user cancels their subscription, you will receive an `ENTITLEMENT_UPDATE` event with an `ends_at` timestamp representing when the subscription ends and when related premium functionality should be revoked.
40
-
-If the user changes their mind and reactivates their subscription, you will receive another`ENTITLEMENT_UPDATE` event setting the`ends_at` timestamp to null.
39
+
- When a user cancels their subscription, your app will not receive any entitlement events.
40
+
-When a subscription ends, the entitlement to the subscription will end. Developers will receive an`ENTITLEMENT_UPDATE` event with an`ends_at` timestamp indicating when the subscription ended.
41
41
42
42
Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration) for more information on what is changing and how to prepare.
43
+
44
+
### Using Subscription Events for the Subscription Lifecycle
45
+
46
+
Because entitlements are granted indefinitely and don't update on renewal or cancellation, you can use subscription events to track the lifecycle of a subscription.
47
+
48
+
> info
49
+
> This is not a complete list of when events may occur. You should use the presence of an entitlement to determine if a user has access to your premium features. The Subscription API and related events are intended for reporting and lifecycle management purposes and **should not be used as the source of truth of whether a user has access to your premium features**.
50
+
51
+
| Event Name | Subscription Behavior | Updated Fields |
|`SUBSCRIPTION_CREATE`| Subscription is created |`status` is either `0 (active)` if an entitlement has been granted or `1 (ending)` if an entitlement has not yet been granted |
54
+
|`SUBSCRIPTION_UPDATE`| Subscription is granted an entitlement |`status` is `0 (active)`|
55
+
|`SUBSCRIPTION_UPDATE`| Subscription is renewed |`current_period_start`, `current_period_end` timestamps updated |
56
+
|`SUBSCRIPTION_UPDATE`| Subscription is canceled |`canceled_at` timestamp updated, `status` is `1 (ending)`|
57
+
|`SUBSCRIPTION_UPDATE`| Subscription ends |`status` is `2 (inactive)`, this event is processed asynchronously and will not be immediate |
58
+
|`SUBSCRIPTION_UPDATE`| Subscription is resumed/uncanceled by user |`status` is `0 (active)`|
59
+
60
+
> info
61
+
> These docs will be incorporated into the main documentation on November 1, 2024.
62
+
43
63
</Collapsible>
44
64
45
65
---
@@ -53,15 +73,17 @@ Depending on your app's features, you can use a combination of [Gateway events](
53
73
### Accessing Entitlements with Gateway Events
54
74
55
75
> danger
56
-
> **Starting on October 1st, 2024**, the `ENTITLEMENT_CREATE` and `ENTITLEMENT_UPDATE` event behavior is changing. Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration) for more information on what is changing and how to prepare.
76
+
> **Starting on October 1, 2024**, the `ENTITLEMENT_CREATE` and `ENTITLEMENT_UPDATE` event behavior described below is changing. Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration) for more information on what is changing and how to prepare. The docs will be updated on November 1, 2024 to reflect the new behavior.
57
77
58
78
When users subscribe or renew a subscription with your app, Discord will emit [Entitlement Gateway events](#DOCS_TOPICS_GATEWAY_EVENTS/entitlements).
59
79
60
-
For subscription SKUs, you will receive the following events:
80
+
For subscription SKUs, you will receive the following entitlement events:
61
81
62
-
-[`ENTITLEMENT_CREATE`](#DOCS_TOPICS_GATEWAY_EVENTS/entitlement-create): When a user subscribes to your app.
63
-
-[`ENTITLEMENT_UPDATE`](#DOCS_TOPICS_GATEWAY_EVENTS/entitlement-update): When a user renews their subscription.
64
-
-[`ENTITLEMENT_DELETE`](#DOCS_TOPICS_GATEWAY_EVENTS/entitlement-delete): When Discord refunds a subscription, removes an entitlement, or when a developer [deletes a Test Entitlement](#DOCS_RESOURCES_ENTITLEMENT/delete-test-entitlement).
|`ENTITLEMENT_CREATE`| When a user is granted an entitlement to your app's subscription SKU |
85
+
|`ENTITLEMENT_UPDATE`| When a subscription is resumed, renewed, or canceled |
86
+
|`ENTITLEMENT_DELETE`| When Discord refunds a subscription, removes an entitlement, or when a developer [deletes a Test Entitlement](#DOCS_RESOURCES_ENTITLEMENT/delete-test-entitlement)|
Copy file name to clipboardExpand all lines: docs/topics/Gateway_Events.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -591,7 +591,7 @@ Sent when an entitlement is created. The inner payload is an [entitlement](#DOCS
591
591
#### Entitlement Update
592
592
593
593
> danger
594
-
> Starting on October 1st, 2024, the `ENTITLEMENT_UPDATE` event behavior will be changing. You will no longer receive an `ENTITLEMENT_UPDATE` event on successful renewal When a user cancels, you will receive an `ENTITLEMENT_UPDATE` events with a valid `ends_at` value reflecting when their subscription ends. Please see the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration) for more information.
594
+
> Starting on October 1, 2024, the `ENTITLEMENT_UPDATE` event behavior will be changing. You will no longer receive an `ENTITLEMENT_UPDATE` event on successful renewal When a user cancels, you will receive an `ENTITLEMENT_UPDATE` events with an `ends_at` value when the subscription ends. See the [Change Log and Entitlement Migration Guide](#DOCS_CHANGE_LOG/subscription-api-and-entitlement-migration) for more information.
595
595
596
596
Sent when an entitlement is updated. The inner payload is an [entitlement](#DOCS_RESOURCES_ENTITLEMENT/entitlement-object) object.
0 commit comments