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
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ It assumes an understanding of [JavaScript](https://developer.mozilla.org/en-US/
16
16
17
17
<Collapsibletitle="What we'll be building"icon="view">
18
18
19
-

19
+

20
20
21
21
</Collapsible>
22
22
@@ -145,7 +145,7 @@ You can learn more about the OAuth flow and redirect URIs in the [OAuth2 documen
145
145
146
146
Click on **OAuth2** on the sidebar in your app's settings. Under **Redirects**, enter `https://127.0.0.1` as a placeholder value then click **Save Changes**.
147
147
148
-

148
+

149
149
150
150
### Fetch Your OAuth2 Credentials
151
151
@@ -310,7 +310,7 @@ Because Activities are in a sandbox enviornment and go through the Discord proxy
310
310
311
311
Back in your app's settings, click on the **URL Mappings** page under **Activities** on the left-hand sidebar. Enter the URL you generated from `cloudflared` in the previous step.
312
312
313
-

313
+

- This allows for easier drop-in drop-out behavior for the large portion of mobile users on Discord.
@@ -80,7 +80,7 @@ Make your app fast, easy to join, and maximize fun to launch a crowd favorite.
80
80
- Activities are frictionless to join and easy to discover, so you can expect that users will join mid-experience. Give those users something to do, even if it's just letting them spectate until they can join without being disruptive. In the same vein, users can leave without notice or become afk (away from keyboard). Handle these cases gracefully.
81
81
- Create a case for users who have joined a call but have not yet started playing or engaging. Allow these users to "spectate" other users who are playing. This can also be helpful for Activities that have an ideal number in mind for play.
82
82
83
-

83
+

84
84
85
85
### Make your app as available as possible
86
86
@@ -105,7 +105,7 @@ Discord is a social platform where users talk to each other. Sharing and invites
105
105
- Share photos or GIFs that capture moments of fun and memorable, or something to brag about. Don't make things shareable just to feature the activity.
106
106
- Sharing a high score alone may not be very engaging, but sharing a really good move made in a game, or a collaborative drawing that creates a memory is a conversation starter and may make others want to join in on the fun.
107
107
108
-

108
+

109
109
110
110
#### Activities in Text Channels
111
111
- The Activity user interface, copy and user flows should not rely on people in voice to explain, organize, clarify, or instruct about how the activity works.
Users will see an embed with your information displayed. Clicking "Play" opens the activity and passes through the `custom_id` you've set. A `referrer_id` will be present for links shared on Discord.
It's also possible to configure an application with a default orientation lock state via the Developer Portal. Using this method, the Discord app will apply the orientation lock when launching the application before the SDK has been initialized. This can create a smoother application launch flow where the application starts in the correct orientation rather than switching to the correct orientation after some delay after the application requests an orientation lock via the SDK. The Developer Portal supports setting a different default orientation lock states for phones versus tablets.
In the Discord Developer Portal, update the Application URL mapping for `/` url to `funky-jogging-bunny.trycloudflare.com` to match your network tunnel address and save your changes.
43
43
44
-

44
+

45
45
46
46
:::warn
47
47
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.
@@ -59,7 +59,7 @@ The flow for setting up your production application is very similar:
59
59
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.
60
60
61
61
This application now uses the same configuration it will use once it is fully published ✨.
@@ -96,7 +96,7 @@ Because your application is "sandboxed", it will be unable to make network reque
96
96
97
97
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.
98
98
99
-

99
+

100
100
101
101
#### Prefix/Target formatting rules
102
102
@@ -108,10 +108,10 @@ To add or modify your application's URL mappings, click on `Activities -> URL Ma
108
108
- Targets must point to a directory; setting a target to a file (e.g. `example.com/index.html`) is unsupported and may lead to unexpected behavior.
109
109
- Because of how URL globbing works, if you have multiple prefix urls with the same initial path, you must place the shortest of the prefix paths last in order for each url mapping to be reachable. For example, if you have `/foo` and `/foo/bar`, you must place the url `/foo/bar` before `/foo` or else the mapping for `/foo/bar` will never be reached.
Copy file name to clipboardExpand all lines: docs/activities/development-guides/mobile.mdx
+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,7 +15,7 @@ By default, your Activity will be launchable on web/desktop. To enable or disabl
15
15
- Select `Activities` -> `Settings` in the left-side of the developer portal, or visit `https://discord.com/developers/<your app id>/embedded/settings`
16
16
- From check the appropriate checkboxes in the developer portal, and save your changes
When a user clicks "Join Application", they expect to enter the same application that their friends are participating in. Whether the application is a shared drawing canvas, board game, collaborative playlist, or first-person shooter; the two users should have access to the same shared data. In this documentation, we refer to this shared data as an **application instance**.
The Embedded App SDK allows your app to talk bidirectionally with the Discord Client. The `instanceId` is necessary for your application, as well as Discord, to understand which unique instance of an application it is talking to.
With this API, the activity's backend can verify that a client is in fact in an instance of that activity before allowing the client to participate in any meaningful gameplay. How an activity implements"session verification" is left to the developer's discretion. The solution can be as granular as gating specific features or as binary as not returning the activity HTML except for valid sessions.
152
152
153
153
In the below flow diagram, we show how the server can deliver the activity website, only for valid users in a valid activity instance:
Users will see a modal inside the Discord app notifying them whether or not they want to proceed. By clicking **_Trust this Domain_**, users will not see a modal for that specific domain again.
**Activities** are multiplayer games and social experiences that can be launched in Discord. Activities can integrate with Discord features like user identity, voice and chat, profile data like Rich Presence, and native monetization.
0 commit comments