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
Read details about URL Mapping [in the development guide](/docs/activities/development-guides#url-mapping).
319
+
Read details about URL Mapping [in the development guide](/docs/activities/development-guides/local-development#url-mapping).
320
320
321
321
### Enable Activities
322
322
@@ -330,7 +330,7 @@ Find the first checkbox, labeled `Enable Activities`. Turn it on 🎉
330
330
331
331
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.
332
332
333
-
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).
333
+
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/user-actions#setting-up-an-entry-point-command).
334
334
335
335
336
336
### Running your Activity in Discord
@@ -346,7 +346,7 @@ Clicking on your app will launch your locally running app from inside Discord!
346
346
:::info
347
347
**Customizing your Activity**
348
348
349
-
If you'd like to set images for your Activity, you can learn how to do that [here](/docs/activities/development-guides#setting-up-activity-metadata).
349
+
If you'd like to set images for your Activity, you can learn how to do that [here](/docs/activities/development-guides/assets-and-metadata#setting-up-activity-metadata).
350
350
:::
351
351
352
352
We're looking pretty good so far, but we haven't wired up any Discord functionality yet. Let's do that next.
@@ -461,7 +461,7 @@ Before we call your backend activity server, we need to be aware of the Discord
461
461
For this tutorial, we are going to prefix the API call to `/api/token/` with `/.proxy`, but you can also use the SDK's `patchUrlMappings()` method to automatically prefix calls to your external resources for the proxy.
462
462
:::
463
463
464
-
Learn more about this topic in the guides for [Constructing a Full URL](/docs/activities/development-guides#construct-a-full-url) and [Using External Resources](/docs/activities/development-guides#using-external-resources).
464
+
Learn more about this topic in the guides for [Constructing a Full URL](/docs/activities/development-guides/networking#construct-a-full-url) and [Using External Resources](/docs/activities/development-guides/networking#using-external-resources).
465
465
466
466
### Calling your backend server from your client
467
467
@@ -515,7 +515,7 @@ async function setupDiscordSdk() {
515
515
// Retrieve an access_token from your activity's server
516
516
// Note: We need to prefix our backend `/api/token` route with `/.proxy` to stay compliant with the CSP.
517
517
// Read more about constructing a full URL and using external resources at
Copy file name to clipboardExpand all lines: docs/activities/development-guides/growth-and-referrals.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,7 @@ async function handleReferral() {
100
100
101
101
## Creating and Managing Custom Incentivized Links
102
102
103
-
This guide covers creating a customizable [Incentivized Link](/docs/activities/development-guides#prompting-users-to-share-incentivized-links) through the dev portal, and then retrieving the link to be able to share it off-platform. Incentivized Links are used to customize how the embed appears to users.
103
+
This guide covers creating a customizable [Incentivized Link](/docs/activities/development-guides/growth-and-referrals#prompting-users-to-share-incentivized-links) through the dev portal, and then retrieving the link to be able to share it off-platform. Incentivized Links are used to customize how the embed appears to users.
104
104
105
105
#### Creating a Link
106
106
@@ -146,7 +146,7 @@ Users will see an embed with your information displayed. Clicking "Play" opens t
146
146
147
147
## Generating a Custom Link Within Your Activity
148
148
149
-
This guide covers creating a customizable [Incentivized Link](/docs/activities/development-guides#prompting-users-to-share-incentivized-links) within your activity, and using the `shareLink` API to share the link.
149
+
This guide covers creating a customizable [Incentivized Link](/docs/activities/development-guides/growth-and-referrals#prompting-users-to-share-incentivized-links) within your activity, and using the `shareLink` API to share the link.
150
150
151
151
* Allows you to customize the way the link is presented to users via the embed
Copy file name to clipboardExpand all lines: docs/activities/development-guides/local-development.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,17 @@ sidebar_label: Local Development
6
6
7
7
## Run Your Application Locally
8
8
9
-
It is possible to load your application via a localhost port or other unique URL. This URL must support an HTTPS connection to load on the web/desktop Discord app (HTTPS is not required for mobile). The downside to this flow is that your application's network traffic will not pass through Discord's proxy, which means any requests made by the application will need to use a full URL instead of a ["mapped"](/docs/activities/development-guides#url-mapping) URL.
9
+
It is possible to load your application via a localhost port or other unique URL. This URL must support an HTTPS connection to load on the web/desktop Discord app (HTTPS is not required for mobile). The downside to this flow is that your application's network traffic will not pass through Discord's proxy, which means any requests made by the application will need to use a full URL instead of a ["mapped"](/docs/activities/development-guides/local-development#url-mapping) URL.
10
10
11
-
To run your locally hosted application, follow the instructions for [Launching your Application from the Discord Client](/docs/activities/development-guides#launch-your-application-from-the-discord-client) and set the Application URL Override to the address of your application's web server.
11
+
To run your locally hosted application, follow the instructions for [Launching your Application from the Discord Client](/docs/activities/development-guides/local-development#launch-your-application-from-the-discord-client) and set the Application URL Override to the address of your application's web server.
12
12
13
13
### Running Your Application Through A Network Tunnel
14
14
15
15
Although it is possible to test your application locally, we recommend developing and testing against the Discord proxy. This is helpful to make sure all URLs behave as expected before your application runs in production. One technique to enable testing locally against the proxy is to use a network tunneling tool, such as [cloudflared](https://github.com/cloudflare/cloudflared#installing-cloudflared). A typical pattern is for each developer to have their own "development-only" application. To set up a local environment to run through Discord's proxy, you will need to do the following:
16
16
17
17
1. Create a new application in the Discord Developer portal.
18
18
2. Enable Activities for your app.
19
-
3. Set up the application's [URL mapping](/docs/activities/development-guides#url-mapping).
19
+
3. Set up the application's [URL mapping](/docs/activities/development-guides/local-development#url-mapping).
20
20
4. Locally, spin up your web server.
21
21
5. Install and run a tunnel solution, such as [cloudflared](https://github.com/cloudflare/cloudflared#installing-cloudflared). You will point it to your local web server.
22
22
@@ -45,16 +45,16 @@ In the Discord Developer Portal, update the Application URL mapping for `/` url
45
45
If you do not own the URL that you are using to host the application (i.e. ngrok's free tier), someone else could claim that domain and host a malicious site in its place. Please be aware of these risks, and if you have to use a domain you do not own, be sure to reset your URL mapping when you are done using the tunnel.
46
46
:::
47
47
48
-
Follow the instructions for [Launching your Application from the Discord Client](/docs/activities/development-guides#launch-your-application-from-the-discord-client). Application URL Override should not be enabled.
48
+
Follow the instructions for [Launching your Application from the Discord Client](/docs/activities/development-guides/local-development#launch-your-application-from-the-discord-client). Application URL Override should not be enabled.
49
49
50
50
### Running Your Application In Production
51
51
52
52
The flow for setting up your production application is very similar:
53
53
54
54
1. If not made yet, create a new application.
55
55
2. Enable Activities for your app.
56
-
3. Set up the application's [URL Mapping](/docs/activities/development-guides#url-mapping). The URL for your application's html should be set to the `/` route.
57
-
4. Follow the instructions for [Launching your Application from the Discord Client](/docs/activities/development-guides#launch-your-application-from-the-discord-client)). Application URL Override should not be enabled.
56
+
3. Set up the application's [URL Mapping](/docs/activities/development-guides/local-development#url-mapping). The URL for your application's html should be set to the `/` route.
57
+
4. Follow the instructions for [Launching your Application from the Discord Client](/docs/activities/development-guides/local-development#launch-your-application-from-the-discord-client)). Application URL Override should not be enabled.
58
58
59
59
This application now uses the same configuration it will use once it is fully published ✨.
Copy file name to clipboardExpand all lines: docs/activities/development-guides/networking.mdx
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,6 @@ While we currently only support websockets, we're working with our upstream prov
18
18
19
19
WebRTC is not supported.
20
20
21
-
Other guides are available in this [Networking](/docs/activities/development-guides#networking) section for using external network resources and constructing a full url versus relative urls.
22
-
23
21
---
24
22
25
23
## Construct A Full URL
@@ -51,7 +49,7 @@ In other words, given an application client id of `12345678`
51
49
52
50
## Using External Resources
53
51
54
-
Activities in Discord are "sandboxed" via a Discord proxy. This is done to hide the users' IP addresses as well as block URLs from known malicious endpoints. To achieve this, the Discord Developer Portal has a section for [configuring URL Mappings](/docs/activities/development-guides#url-mapping) for your application.
52
+
Activities in Discord are "sandboxed" via a Discord proxy. This is done to hide the users' IP addresses as well as block URLs from known malicious endpoints. To achieve this, the Discord Developer Portal has a section for [configuring URL Mappings](/docs/activities/development-guides/local-development#url-mapping) for your application.
55
53
56
54
One edge-case of URL mappings is that third-party NPM modules or other resources may reference external (non-sandboxed) urls.
Copy file name to clipboardExpand all lines: docs/activities/overview.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ Activities are primarily opened when users invoke your app's [Entry Point comman
38
38
39
39
When you enable Activities for your app, a [default Entry Point command](/docs/interactions/application-commands#default-entry-point-command) called "Launch" is created for you. By default, Discord automatically handles opening your Activity when your Entry Point command is run by a user.
40
40
41
-
Read more about setting up Entry Point commands in the [development guide](/docs/activities/development-guides#setting-up-an-entry-point-command).
41
+
Read more about setting up Entry Point commands in the [development guide](/docs/activities/development-guides/user-actions#setting-up-an-entry-point-command).
42
42
43
43
### Interaction Response
44
44
@@ -54,7 +54,7 @@ The sections below provide an overview of the Embedded App SDK, but technical de
54
54
55
55
### Embedded App SDK
56
56
57
-
The [Embedded App SDK](/docs/developer-tools/embedded-app-sdk) handles all of the communication between Discord and your app, making it easier to do common tasks like managing connected users, supporting mobile clients, and debugging your Activity.
57
+
The [Embedded App SDK](/docs/developer-tools/embedded-app-sdk) handles all of the communication between Discord and your app, making it easier to do common tasks like managing connected users, supporting mobile clients, and debugging your Activity.
58
58
59
59
The Embedded App SDK offers different events and commands to handle the communication between Discord and your Activity, which are covered more below.
Copy file name to clipboardExpand all lines: docs/change-log/2024-07-17-activities-proxy-csp-update.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,6 @@ our CSP will be updated as follows:
15
15
* Only allowed paths on `cdn.discordapp.com` and `media.discordapp.net` will be permitted such as `/attachments/`, `/icons/`, and `/avatars/`.
16
16
* nested child iframes must also mount paths prepended by `/.proxy/`
17
17
18
-
As of [embedded-app-sdk v1.4.0](https://github.com/discord/embedded-app-sdk/releases/tag/v1.4.0) we have updated `patchUrlMappings` to automatically route requests through `/.proxy/`, so updating your SDK version calling `patchUrlMappings` is a good first step. If you are unfamiliar with `patchUrlMappings`, please consult the [documentation](/docs/activities/development-guides#using-external-resources).
18
+
As of [embedded-app-sdk v1.4.0](https://github.com/discord/embedded-app-sdk/releases/tag/v1.4.0) we have updated `patchUrlMappings` to automatically route requests through `/.proxy/`, so updating your SDK version calling `patchUrlMappings` is a good first step. If you are unfamiliar with `patchUrlMappings`, please consult the [documentation](/docs/activities/development-guides/networking#using-external-resources).
19
19
20
20
All Application IDs created after `07/17/2024 12:00:00` UTC (applicationID greater than `1263102905548800000`) will also automatically have the new CSP applied. Testing your production code on a new application created after this date is a suggested way for developers to test compliance with this new CSP.
Copy file name to clipboardExpand all lines: docs/change-log/2024-08-26-entry-point-commands.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,8 @@ When creating or updating an Entry Point command, an [Entry Point handler](/docs
12
12
- If the value is `DISCORD_LAUNCH_ACTIVITY` (`2`), Discord will automatically handle the interaction and send a follow-up message to the channel where the Entry Point command was invoked from.
13
13
- If the value is `APP_HANDLER` (`1`), your app will receive an interaction token and will be responsible for responding to the interaction. In this case, you can launch your Activity using the `LAUNCH_ACTIVITY` (type `12`) [interaction callback](/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type).
14
14
15
-
More details about Entry Point commands can be found in the [Application Commands documentation](/docs/interactions/application-commands#entry-point-commands) and in the [Activity development guide](/docs/activities/development-guides#setting-up-an-entry-point-command).
15
+
More details about Entry Point commands can be found in the [Application Commands documentation](/docs/interactions/application-commands#entry-point-commands) and in the [Activity development guide](/docs/activities/development-guides/user-actions#setting-up-an-entry-point-command).
16
16
17
17
### Default Entry Point Commands
18
18
19
-
Starting today, when you enable Activities in your [app's settings](http://discord.com/developers/applications), a [default Entry Point command](/docs/interactions/application-commands#default-entry-point-command) called "Launch" will automatically be created for your app. This can be customized or deleted like other commands if you want to update the name or handler type.
19
+
Starting today, when you enable Activities in your [app's settings](http://discord.com/developers/applications), a [default Entry Point command](/docs/interactions/application-commands#default-entry-point-command) called "Launch" will automatically be created for your app. This can be customized or deleted like other commands if you want to update the name or handler type.
0 commit comments