Skip to content

Commit 6dcfa8a

Browse files
Remove .proxy/
1 parent 6ad2ad4 commit 6dcfa8a

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

docs/activities/building-an-activity.mdx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -457,10 +457,6 @@ We can now run our server and client-side apps in separate terminal windows. You
457457
458458
Before we call your backend activity server, we need to be aware of the Discord proxy and understand how to avoid any Content Security Policy (CSP) issues.
459459
460-
:::info
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-
:::
463-
464460
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).
465461
466462
### Calling your backend server from your client
@@ -513,10 +509,7 @@ async function setupDiscordSdk() {
513509
});
514510
515511
// Retrieve an access_token from your activity's server
516-
// Note: We need to prefix our backend `/api/token` route with `/.proxy` to stay compliant with the CSP.
517-
// Read more about constructing a full URL and using external resources at
518-
// https://discord.com/developers/docs/activities/development-guides/networking#construct-a-full-url
519-
const response = await fetch("/.proxy/api/token", {
512+
const response = await fetch("/api/token", {
520513
method: "POST",
521514
headers: {
522515
"Content-Type": "application/json",

docs/activities/development-guides/networking.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ There are scenarios where instead of using a relative url (`/path/to/my/thing`)
2929
1. The protocol you wish to use
3030
2. Your application's client id
3131
3. The discord proxy domain
32-
4. The `/.proxy` path prefix
33-
5. Whatever you need to list
32+
4. Whatever you need to list
3433

3534
Here's an example of how to build a full url, using the URL constructor:
3635

@@ -39,13 +38,13 @@ const protocol = `https`;
3938
const clientId = '<YOUR CLIENT ID>';
4039
const proxyDomain = 'discordsays.com';
4140
const resourcePath = '/foo/bar.jpg';
42-
const url = new URL(`${protocol}://${clientId}.${proxyDomain}/.proxy${resourcePath}`);
41+
const url = new URL(`${protocol}://${clientId}.${proxyDomain}${resourcePath}`);
4342
```
4443

4544
In other words, given an application client id of `12345678`
4645
| Relative Path | Full Path |
4746
|---------------|-----------------------------------------------------|
48-
| /foo/bar.jpg | https://12345678.discordsays.com/.proxy/foo/bar.jpg |
47+
| /foo/bar.jpg | https://12345678.discordsays.com/foo/bar.jpg |
4948

5049
---
5150

docs/activities/how-activities-work.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async function setup() {
4141
});
4242

4343
// Retrieve an access_token from your application's server
44-
const response = await fetch('/.proxy/api/token', {
44+
const response = await fetch('/api/token', {
4545
method: 'POST',
4646
headers: {
4747
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)