discord/embedded-app-sdk

external resources issue

Closed this issue · 1 comments

Hi Discord! I meet problems when request external resources.

I am building a game activities using embedded-app-sdk.

tech: Nodejs + Threejs + third party sdk.

Code:
image

Problem:
image

I try to solve the problem using patchUrlMappings:
image
and change the url.
image
But still get error:
image

Hi!
Here's the docs around patchUrlMappings if you haven't seen them: https://discord.com/developers/docs/activities/development-guides#using-external-resources

Basically, if you have control over the URL yourself (as you do) you'll want to just use the URL you set up in mappings directly. You won't even have to use patchUrlMappings since you can address the proxy directly instead.

patchUrlMappings only exists in case you didn't have the code to address the proxied URL yourself (i.e. if it came from a third-party library).

Feel free to reopen in case this doesn't answer the question. Thanks!