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: CONTRIBUTING.md
+5-4
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ For example:
45
45
> Something that requires warning here
46
46
```
47
47
48
-

48
+

49
49
50
50
### MDX Components
51
51
@@ -56,6 +56,7 @@ There are a few reusable MDX components that can be used on pages with the `mdx`
56
56
Collapsibles allow you to show/hide content on a page that may be secondary to the page's primary content. They have four fields that can be set: `title`, `description`, `icon`, and an `open` flag (which makes the collapsible element open by default).
57
57
58
58
Available options for `icon`:
59
+
59
60
-`"list"`
60
61
-`"view"`
61
62
-`"question"`
@@ -64,7 +65,7 @@ Available options for `icon`:
64
65
65
66
###### Example
66
67
67
-

68
+

Copy file name to clipboardExpand all lines: docs/activities/building-an-activity.mdx
+9-9
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
@@ -142,7 +142,7 @@ You can learn more about the OAuth flow and redirect URIs in the [OAuth2 documen
142
142
143
143
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**.
144
144
145
-

145
+

146
146
147
147
### Fetch Your OAuth2 Credentials
148
148
@@ -297,7 +297,7 @@ Because Activities are in a sandbox enviornment and go through the Discord proxy
297
297
298
298
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.
299
299
300
-

300
+

@@ -311,7 +311,7 @@ Next, we'll need to enable Activities for your app. On the left hand sidebar und
311
311
312
312
Find the first checkbox, labeled `Enable Activities`. Turn it on 🎉
313
313
314
-

314
+

315
315
316
316
#### Default Entry Point Command
317
317
@@ -328,7 +328,7 @@ Navigate to your Discord test server and, in any voice and or text channel, open
328
328
329
329
Clicking on your app will launch your locally running app from inside Discord!
330
330
331
-

331
+

332
332
333
333
> info
334
334
> **Customizing your Activity** <br/> 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).
@@ -356,7 +356,7 @@ We will use `express` for this example, but any backend language or framework wi
356
356
357
357
This diagram illustrates the common pattern for granting a user an OAuth2 access_token:
358
358
359
-

359
+

360
360
361
361
We will be implementing this pattern in this tutorial, but more example implementations can also be found in this sample project:
- 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.
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.
174
174
175
-

175
+

176
176
177
177
> warn
178
178
> 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.
@@ -189,7 +189,7 @@ The flow for setting up your production application is very similar:
189
189
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.
190
190
191
191
This application now uses the same configuration it will use once it is fully published ✨.
@@ -226,7 +226,7 @@ Because your application is "sandboxed", it will be unable to make network reque
226
226
227
227
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.
228
228
229
-

229
+

230
230
231
231
#### Prefix/Target formatting rules
232
232
@@ -238,10 +238,10 @@ To add or modify your application's URL mappings, click on `Activities -> URL Ma
238
238
- 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.
239
239
- 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.
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.
@@ -516,7 +516,7 @@ By default, your Activity will be launchable on web/desktop. To enable or disabl
516
516
- Select `Activities` -> `Settings` in the left-side of the developer portal, or visit `https://discord.com/developers/<your app id>/embedded/settings`
517
517
- From check the appropriate checkboxes in the developer portal, and save your changes
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.
@@ -772,7 +772,7 @@ Rest assured: other activities will not be able to make requests with your activ
772
772
773
773
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.
778
778
@@ -1027,7 +1027,7 @@ Once you're satisfied with your changes you can click on the copy icon on the ro
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.
With thisAPI, 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.
1092
1092
1093
1093
In the below flow diagram, we show how the server can deliver the activity website, only for valid users in a valid activity instance:
**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.
Copy file name to clipboardExpand all lines: docs/developer-tools/game-sdk.mdx
+4-4
Original file line number
Diff line number
Diff line change
@@ -232,11 +232,11 @@ You're ready to go! Check out the rest of the documentation for more info on how
232
232
In your project folder, you'll want to make something like a "discord-files" folder, for organization. In that folder, copy all the `.h` and `.cpp` files from the zip.
233
233
You want to include all the header and source files respectively in your project
234
234
235
-

235
+

236
236
237
237
In your project settings, you'll want to include the relevant library (e.g. `discord_game_sdk.dll.lib`) as an additional dependency.
238
238
239
-

239
+

240
240
241
241
- From there, you should be able to `#include "discord-files/discord.h"`, or whatever the path to that header file is, and have access to the code.
242
242
</Collapsible>
@@ -1274,7 +1274,7 @@ Opens the overlay widget for voice settings for the currently connected applicat
1274
1274
1275
1275
<Collapsibletitle="Screenshot of the Voice Settings modal for an application"icon="view">
1276
1276
1277
-

1277
+

0 commit comments