Configure URL Mappings and proxy patching so a Discord Activity's network calls work inside the sandboxed iframe
domain: discord.com/developers · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
In the Discord Developer Portal, open your app's Activities settings and add URL Mappings that route requests from https://<client_id>.discordsays.com/<path> to your backend's target domain.
Register your Activity's root mapping ("/") to your app's frontend host so the iframe loads correctly when launched from a voice channel or DM.
For third-party or external URLs your frontend code calls directly (analytics, CDNs, APIs) that aren't covered by static mappings, use the Embedded App SDK's patchUrlMappings to rewrite fetch, WebSocket, and XMLHttpRequest calls at runtime.
Test locally with a tunnel mapped to the same URL Mapping pattern, since the Discord proxy intercepts all network traffic even in development.
Expect requests to unmapped external domains to fail with a blocked network error, since the Discord proxy blocks anything not explicitly mapped.
Known gotchas
All Activity network traffic is routed through Discord's proxy for privacy — direct unproxied calls to arbitrary third-party domains will be blocked regardless of CORS configuration.
URL Mapping changes in the Developer Portal are not always applied instantly to already-open Activity sessions; reload/relaunch during testing.
patchUrlMappings must be applied before any code makes the network calls it's meant to intercept, so call it early in app initialization.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?