Full Code of discord/discord-api-docs for AI

main 639452bd569e
302 files
3.5 MB
946.3k tokens
39 symbols
Showing preview only (3,779K chars total). The displayed content is truncated. Use the JSON API for full output.
Extracted by GitExtract (https://gitextract.com)
Repository: discord/discord-api-docs
Branch: main
Commit: 639452bd569e
Files: 302
Total size: 3.5 MB

Directory structure:
discord-api-docs/

├── .gitattributes
├── .github/
│   ├── CODEOWNERS
│   ├── ISSUE_TEMPLATE/
│   │   ├── api-bug-report.yml
│   │   ├── app-subscriptions-bug-report.yml
│   │   ├── config.yml
│   │   ├── developer-site-bug-report.yml
│   │   ├── message-components-bug-report.yml
│   │   └── slash-command-bug-report.yml
│   ├── dependabot.yml
│   └── workflows/
│       ├── docs.yaml
│       └── test.yaml
├── .gitignore
├── .husky/
│   └── pre-commit
├── .mintignore
├── .vale.ini
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── LICENSE-CODE
├── README.md
├── developers/
│   ├── activities/
│   │   ├── building-an-activity.mdx
│   │   ├── design-patterns.mdx
│   │   ├── development-guides/
│   │   │   ├── assets-and-metadata.mdx
│   │   │   ├── growth-and-referrals.mdx
│   │   │   ├── layout.mdx
│   │   │   ├── local-development.mdx
│   │   │   ├── mobile.mdx
│   │   │   ├── multiplayer-experience.mdx
│   │   │   ├── networking.mdx
│   │   │   ├── production-readiness.mdx
│   │   │   └── user-actions.mdx
│   │   ├── development-guides.mdx
│   │   ├── how-activities-work.mdx
│   │   └── overview.mdx
│   ├── bots/
│   │   └── overview.mdx
│   ├── change-log.mdx
│   ├── communities/
│   │   └── guides/
│   │       └── community-invites.mdx
│   ├── components/
│   │   ├── overview.mdx
│   │   ├── reference.mdx
│   │   ├── using-message-components.mdx
│   │   └── using-modal-components.mdx
│   ├── developer-tools/
│   │   ├── community-resources.mdx
│   │   ├── embedded-app-sdk.mdx
│   │   └── game-sdk.mdx
│   ├── discord-social-sdk/
│   │   ├── core-concepts/
│   │   │   ├── communication-features.mdx
│   │   │   ├── core-features.mdx
│   │   │   ├── integration-overview.mdx
│   │   │   ├── mobile.mdx
│   │   │   ├── oauth2-scopes.mdx
│   │   │   ├── platform-compatibility.mdx
│   │   │   └── release-cadence-and-support.mdx
│   │   ├── core-concepts.mdx
│   │   ├── design-guidelines/
│   │   │   ├── branding-guidelines.mdx
│   │   │   ├── chat-history.mdx
│   │   │   ├── connection-points.mdx
│   │   │   ├── consoles.mdx
│   │   │   ├── direct-messages.mdx
│   │   │   ├── game-friends.mdx
│   │   │   ├── linked-channels.mdx
│   │   │   ├── principles.mdx
│   │   │   ├── provisional-accounts.mdx
│   │   │   ├── signing-in.mdx
│   │   │   ├── social-settings.mdx
│   │   │   ├── status-rich-presence.mdx
│   │   │   └── unified-friends-list.mdx
│   │   ├── design-guidelines.mdx
│   │   ├── development-guides/
│   │   │   ├── account-linking-from-discord.mdx
│   │   │   ├── account-linking-on-consoles.mdx
│   │   │   ├── account-linking-on-mobile.mdx
│   │   │   ├── account-linking-on-web.mdx
│   │   │   ├── account-linking-with-discord.mdx
│   │   │   ├── creating-a-unified-friends-list.mdx
│   │   │   ├── linked-channels.mdx
│   │   │   ├── managing-game-invites.mdx
│   │   │   ├── managing-lobbies.mdx
│   │   │   ├── managing-relationships.mdx
│   │   │   ├── managing-voice-chat.mdx
│   │   │   ├── provisional-accounts/
│   │   │   │   ├── bot-token-endpoint.mdx
│   │   │   │   ├── external-credentials-exchange.mdx
│   │   │   │   ├── identity-providers.mdx
│   │   │   │   ├── managing-accounts.mdx
│   │   │   │   ├── merging-accounts.mdx
│   │   │   │   ├── overview.mdx
│   │   │   │   ├── public-client.mdx
│   │   │   │   └── unmerging-accounts.mdx
│   │   │   ├── publisher-level-account-linking.mdx
│   │   │   ├── sending-direct-messages.mdx
│   │   │   ├── setting-rich-presence.mdx
│   │   │   └── unlinking-accounts.mdx
│   │   ├── development-guides.mdx
│   │   ├── getting-started/
│   │   │   ├── partials/
│   │   │   │   ├── dylib-mac-error.mdx
│   │   │   │   └── getting-started.mdx
│   │   │   ├── using-c++.mdx
│   │   │   ├── using-unity.mdx
│   │   │   └── using-unreal-engine.mdx
│   │   ├── getting-started.mdx
│   │   ├── how-to/
│   │   │   ├── debug-log.mdx
│   │   │   ├── handle-rate-limits.mdx
│   │   │   ├── handle-special-characters-display-names.mdx
│   │   │   ├── integrate-moderation.mdx
│   │   │   ├── market-your-integration.mdx
│   │   │   ├── use-with-discord-apis.mdx
│   │   │   └── voice-muting-for-blocked-players.mdx
│   │   ├── how-to.mdx
│   │   ├── overview.mdx
│   │   ├── partials/
│   │   │   └── callouts/
│   │   │       ├── console-access.mdx
│   │   │       ├── oauth-comms-scopes.mdx
│   │   │       ├── public-client.mdx
│   │   │       ├── rate-limit.mdx
│   │   │       ├── sony.mdx
│   │   │       └── support.mdx
│   │   └── social-sdk-reference.mdx
│   ├── discovery/
│   │   ├── best-practices.mdx
│   │   ├── enabling-discovery.mdx
│   │   └── overview.mdx
│   ├── events/
│   │   ├── gateway-events.mdx
│   │   ├── gateway.mdx
│   │   ├── overview.mdx
│   │   └── webhook-events.mdx
│   ├── game-development/
│   │   ├── how-to-add-proximity-voice-chat-to-your-game.mdx
│   │   ├── how-to-create-a-community-for-your-game.mdx
│   │   ├── how-to-get-your-game-seen.mdx
│   │   ├── how-to-grow-your-game.mdx
│   │   └── how-to-keep-your-players-engaged.mdx
│   ├── gateway/
│   │   ├── getting-started-with-privileged-intent-review.mdx
│   │   └── you-might-not-need-a-privileged-intent.mdx
│   ├── guides/
│   │   ├── activities.mdx
│   │   ├── bots.mdx
│   │   ├── communities.mdx
│   │   ├── game-development.mdx
│   │   ├── platform.mdx
│   │   └── social-sdk.mdx
│   ├── guides.mdx
│   ├── interactions/
│   │   ├── application-commands.mdx
│   │   ├── overview.mdx
│   │   └── receiving-and-responding.mdx
│   ├── intro.mdx
│   ├── link-previews/
│   │   ├── component-embeds.mdx
│   │   └── overview.mdx
│   ├── monetization/
│   │   ├── enabling-monetization.mdx
│   │   ├── implementing-app-subscriptions.mdx
│   │   ├── implementing-iap-for-activities.mdx
│   │   ├── implementing-one-time-purchases.mdx
│   │   ├── managing-skus.mdx
│   │   └── overview.mdx
│   ├── platform/
│   │   ├── account-linking.mdx
│   │   ├── activities.mdx
│   │   ├── app-monetization.mdx
│   │   ├── bots.mdx
│   │   ├── claim-your-game.mdx
│   │   ├── community-servers.mdx
│   │   ├── components.mdx
│   │   ├── discovery.mdx
│   │   ├── game-profiles.mdx
│   │   ├── interactions.mdx
│   │   ├── oauth2-and-permissions.mdx
│   │   ├── rich-presence.mdx
│   │   ├── server-and-channel-management.mdx
│   │   ├── social-layer.mdx
│   │   └── webhooks.mdx
│   ├── policies/
│   │   ├── developer-policy.mdx
│   │   └── developer-terms-of-service.mdx
│   ├── quick-start/
│   │   ├── getting-started.mdx
│   │   └── overview-of-apps.mdx
│   ├── reference.mdx
│   ├── resources/
│   │   ├── application-identity-profile.mdx
│   │   ├── application-role-connection-metadata.mdx
│   │   ├── application.mdx
│   │   ├── audit-log.mdx
│   │   ├── auto-moderation.mdx
│   │   ├── channel.mdx
│   │   ├── emoji.mdx
│   │   ├── entitlement.mdx
│   │   ├── guild-scheduled-event.mdx
│   │   ├── guild-template.mdx
│   │   ├── guild.mdx
│   │   ├── invite.mdx
│   │   ├── lobby.mdx
│   │   ├── message.mdx
│   │   ├── poll.mdx
│   │   ├── sku.mdx
│   │   ├── soundboard.mdx
│   │   ├── stage-instance.mdx
│   │   ├── sticker.mdx
│   │   ├── subscription.mdx
│   │   ├── user.mdx
│   │   ├── voice.mdx
│   │   └── webhook.mdx
│   ├── rich-presence/
│   │   ├── best-practices.mdx
│   │   ├── overview.mdx
│   │   └── using-with-the-embedded-app-sdk.mdx
│   ├── social-commerce/
│   │   └── overview.mdx
│   ├── social-layer/
│   │   └── game-stats-widgets/
│   │       ├── best-practices.mdx
│   │       ├── overview.mdx
│   │       ├── sending-game-data.mdx
│   │       └── widget-configuration.mdx
│   ├── topics/
│   │   ├── certified-devices.mdx
│   │   ├── oauth2.mdx
│   │   ├── opcodes-and-status-codes.mdx
│   │   ├── permissions.mdx
│   │   ├── rate-limits.mdx
│   │   ├── rpc.mdx
│   │   ├── teams.mdx
│   │   ├── threads.mdx
│   │   └── voice-connections.mdx
│   └── tutorials/
│       ├── configuring-app-metadata-for-linked-roles.mdx
│       ├── developing-a-user-installable-app.mdx
│       ├── hosting-on-cloudflare-workers.mdx
│       └── using-community-invites.mdx
├── docs.json
├── package.json
├── scripts/
│   └── docs.js
├── snippets/
│   ├── card.mdx
│   ├── discord-social-sdk/
│   │   ├── callouts/
│   │   │   ├── console-access.mdx
│   │   │   ├── console-account-linking.mdx
│   │   │   ├── limited-access.mdx
│   │   │   ├── oauth-comms-scopes.mdx
│   │   │   ├── oauth-presence-scopes.mdx
│   │   │   ├── public-client.mdx
│   │   │   ├── rate-limit.mdx
│   │   │   ├── reuse-stored-token.mdx
│   │   │   ├── sony.mdx
│   │   │   └── support.mdx
│   │   └── partials/
│   │       ├── dylib-mac-error.mdx
│   │       ├── getting-started.mdx
│   │       ├── provisional-account-errors.mdx
│   │       └── provisional-account-oidc-errors.mdx
│   ├── icons/
│   │   ├── ActivitiesIcon.jsx
│   │   ├── AppsIcon.jsx
│   │   ├── BookCheckIcon.jsx
│   │   ├── BrowserIcon.jsx
│   │   ├── BugIcon.jsx
│   │   ├── ChatDotsIcon.jsx
│   │   ├── ChatIcon.jsx
│   │   ├── CircleQuestionIcon.jsx
│   │   ├── ClydeIcon.jsx
│   │   ├── CompassIcon.jsx
│   │   ├── ContactsIcon.jsx
│   │   ├── CrownIcon.jsx
│   │   ├── DoorEnterIcon.jsx
│   │   ├── DpadIcon.jsx
│   │   ├── ForumIcon.jsx
│   │   ├── GameControllerIcon.jsx
│   │   ├── GlobeEarthIcon.jsx
│   │   ├── GroupIcon.jsx
│   │   ├── HammerIcon.jsx
│   │   ├── HashmarkIcon.jsx
│   │   ├── InboxIcon.jsx
│   │   ├── LettersIcon.jsx
│   │   ├── LinkIcon.jsx
│   │   ├── ListViewIcon.jsx
│   │   ├── MagicDoorIcon.jsx
│   │   ├── MagicWandIcon.jsx
│   │   ├── MobilePhoneIcon.jsx
│   │   ├── PaintPaletteIcon.jsx
│   │   ├── PhoneCallIcon.jsx
│   │   ├── PlayIcon.jsx
│   │   ├── RobotIcon.jsx
│   │   ├── ShapesIcon.jsx
│   │   ├── ShieldIcon.jsx
│   │   ├── ShopIcon.jsx
│   │   ├── SlashBoxIcon.jsx
│   │   ├── StarShootingIcon.jsx
│   │   ├── TextControllerIcon.jsx
│   │   ├── TrophyIcon.jsx
│   │   ├── UserIcon.jsx
│   │   ├── UserPlatformIcon.jsx
│   │   ├── UserPlusIcon.jsx
│   │   ├── UserStatusIcon.jsx
│   │   ├── VoiceNormalIcon.jsx
│   │   └── WrenchIcon.jsx
│   ├── imagecard.jsx
│   ├── linkbutton.jsx
│   ├── manualanchor.jsx
│   ├── monospace.jsx
│   ├── route.jsx
│   ├── snowflake.jsx
│   ├── youtube.jsx
│   └── youtubeplaylist.jsx
├── styles/
│   ├── fonts.css
│   ├── imagecard.css
│   ├── linkbutton.css
│   ├── monospace.css
│   ├── route.css
│   ├── snowflake.css
│   ├── theme.css
│   ├── variables.css
│   └── youtubeplaylist.css
├── tools/
│   ├── .prettierrc.json
│   ├── checkBuild.ts
│   ├── doxygen/
│   │   ├── decorate-social-sdk-references.js
│   │   ├── generate-social-sdk-mapping.js
│   │   └── social-sdk-mappings.json
│   ├── eslint.config.js
│   ├── find-unused-images.js
│   ├── optimize-images.js
│   ├── package.json
│   ├── parse-changelog.js
│   ├── rename-files.js
│   └── tsconfig.json
└── vale/
    └── config/
        └── vocabularies/
            ├── Discord/
            │   └── accept.txt
            └── Mintlify/
                └── accept.txt

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitattributes
================================================
# automatically normalize line endings
* text=auto

.git* text
*.json text
*.js text
*.md text linguist-detectable
*.{yml,yaml} text

*.png binary
*.{jpeg,jpg} binary


================================================
FILE: .github/CODEOWNERS
================================================
*   @discord/devrel


================================================
FILE: .github/ISSUE_TEMPLATE/api-bug-report.yml
================================================
name: API Bug Report
description: A bug has been found in Discord's API, Gateway, OAuth2, SDK, etc.
labels: ["bug"]
body:
  - type: markdown
    attributes:
      value: "Before opening a new issue, please search existing issues:  https://github.com/discord/discord-api-docs/issues"
  - type: textarea
    id: description
    attributes:
      label: Description
      description: Provide a clear and concise description of what the problem is.
    validations:
      required: true
  - type: textarea
    id: steps
    attributes:
      label: Steps to Reproduce
      description: Include specific cURL requests that we can copy and paste to replicate your issue. Provide specific, clear, and concise steps for us to reliably reproduce this issue.
    validations:
      required: true
  - type: textarea
    id: expected
    attributes:
      label: Expected Behavior
      description: What is the behavior you expect to occur that is not?
    validations:
      required: true
  - type: textarea
    id: current
    attributes:
      label: Current Behavior
      description: What is the behavior you are currently seeing instead?
    validations:
      required: true
  - type: textarea
    id: screenshots
    attributes:
      label: Screenshots/Videos
      description: Provide a screenshot and/or video demonstrating the issue being experienced.
    validations:
      required: false
  - type: textarea
    id: information
    attributes:
      label: Client and System Information
      description: What is the browser/library/client you are using? What operating system and version?
    validations:
      required: true


================================================
FILE: .github/ISSUE_TEMPLATE/app-subscriptions-bug-report.yml
================================================
name: App Subscriptions Bug Report
description: A bug has been found in Discord's App Subscriptions.
labels: ["bug", "premium-apps"]
body:
  - type: markdown
    attributes:
      value: "Before opening a new issue, please search existing issues:  https://github.com/discord/discord-api-docs/issues?q=is%3Aissue+label%3A%22premium-apps%22"
  - type: textarea
    id: description
    attributes:
      label: Description
      description: Provide a clear and concise description of what the problem is.
    validations:
      required: true
  - type: textarea
    id: steps
    attributes:
      label: Steps to Reproduce
      description: Provide clear and concise steps for us to reliably reproduce this issue.
    validations:
      required: true
  - type: textarea
    id: expected
    attributes:
      label: Expected Behavior
      description: What is the behavior you expect to occur that is not?
    validations:
      required: true
  - type: textarea
    id: current
    attributes:
      label: Current Behavior
      description: What is the behavior you are currently seeing instead?
    validations:
      required: true
  - type: textarea
    id: screenshots
    attributes:
      label: Screenshots/Videos
      description: Provide a screenshot and/or video demonstrating the issue being experienced.
    validations:
      required: false
  - type: textarea
    id: information
    attributes:
      label: Client and System Information
      description: What is the browser/library/client you are using? What operating system and version?
    validations:
      required: true


================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
contact_links:
  - name: API, Application Command, and Message Component Feature Requests
    url: https://github.com/discord/discord-api-docs/discussions
    about: Suggestions for new or different behavior in Discord's API, Gateway, OAuth2, SDK, Application Commands, Message Components, etc.
  - name: Developer Documentation
    url: https://docs.discord.com/developers
    about: Need documentation and examples for the API? Head over to Discord's developer documentation.
  - name: Discord Developers Server
    url: https://discord.gg/discord-developers
    about: Need help with the API? Talk to us in Discord's developers server.
  - name: Discord Feedback & Feature Requests
    url: https://feedback.discord.com
    about: Have feedback that isn't related to the API? Head over to Discord's feedback website.
  - name: Discord Bug Reports
    url: https://dis.gd/bugreport
    about: Have bugs that aren't related to the API? Submit a ticket to Discord's support team.
  - name: Discord Support
    url: https://dis.gd/contact
    about: Need something else? Submit a ticket to Discord's support team.


================================================
FILE: .github/ISSUE_TEMPLATE/developer-site-bug-report.yml
================================================
name: Developer Site Bug Report
description: A bug has been found with Discord's Developer site or documentation.
labels: ["bug", "developer portal"]
body:
  - type: markdown
    attributes:
      value: "Before opening a new issue, please search existing issues:  https://github.com/discord/discord-api-docs/issues?q=is%3Aissue+label%3A%22developer+portal%22"
  - type: textarea
    id: description
    attributes:
      label: Description
      description: Provide a clear and concise description of what the problem is.
    validations:
      required: true
  - type: textarea
    id: steps
    attributes:
      label: Steps to Reproduce
      description: Provide clear and concise steps for us to reliably reproduce this issue.
    validations:
      required: true
  - type: textarea
    id: expected
    attributes:
      label: Expected Behavior
      description: What is the behavior you expect to occur that is not?
    validations:
      required: true
  - type: textarea
    id: current
    attributes:
      label: Current Behavior
      description: What is the behavior you are currently seeing instead?
    validations:
      required: true
  - type: textarea
    id: screenshots
    attributes:
      label: Screenshots/Videos
      description: Provide a screenshot and/or video demonstrating the issue being experienced.
    validations:
      required: false
  - type: textarea
    id: information
    attributes:
      label: Client and System Information
      description: What is the browser/library/client you are using? What operating system and version?
    validations:
      required: true


================================================
FILE: .github/ISSUE_TEMPLATE/message-components-bug-report.yml
================================================
name: Message Components Bug Report
description: A bug has been found in Discord's Message Components.
labels: ["bug", "message components"]
body:
  - type: markdown
    attributes:
      value: "Before opening a new issue, please search existing issues:  https://github.com/discord/discord-api-docs/issues?q=is%3Aissue+label%3A%22message+components%22"
  - type: textarea
    id: description
    attributes:
      label: Description
      description: Provide a clear and concise description of what the problem is.
    validations:
      required: true
  - type: textarea
    id: steps
    attributes:
      label: Steps to Reproduce
      description: Provide clear and concise steps for us to reliably reproduce this issue.
    validations:
      required: true
  - type: textarea
    id: expected
    attributes:
      label: Expected Behavior
      description: What is the behavior you expect to occur that is not?
    validations:
      required: true
  - type: textarea
    id: current
    attributes:
      label: Current Behavior
      description: What is the behavior you are currently seeing instead?
    validations:
      required: true
  - type: textarea
    id: screenshots
    attributes:
      label: Screenshots/Videos
      description: Provide a screenshot and/or video demonstrating the issue being experienced.
    validations:
      required: false
  - type: textarea
    id: information
    attributes:
      label: Client and System Information
      description: What is the browser/library/client you are using? What operating system and version?
    validations:
      required: true


================================================
FILE: .github/ISSUE_TEMPLATE/slash-command-bug-report.yml
================================================
name: Slash Commands Bug Report
description: A bug has been found in Discord's Slash Commands and Interactions.
labels: ["bug", "slash commands"]
body:
  - type: markdown
    attributes:
      value: "Before opening a new issue, please search existing issues:  https://github.com/discord/discord-api-docs/issues?q=is%3Aissue+label%3A%22slash+commands%22"
  - type: textarea
    id: description
    attributes:
      label: Description
      description: Provide a clear and concise description of what the problem is.
    validations:
      required: true
  - type: textarea
    id: steps
    attributes:
      label: Steps to Reproduce
      description: Provide clear and concise steps for us to reliably reproduce this issue.
    validations:
      required: true
  - type: textarea
    id: expected
    attributes:
      label: Expected Behavior
      description: What is the behavior you expect to occur that is not?
    validations:
      required: true
  - type: textarea
    id: current
    attributes:
      label: Current Behavior
      description: What is the behavior you are currently seeing instead?
    validations:
      required: true
  - type: textarea
    id: screenshots
    attributes:
      label: Screenshots/Videos
      description: Provide a screenshot and/or video demonstrating the issue being experienced.
    validations:
      required: false
  - type: textarea
    id: information
    attributes:
      label: Client and System Information
      description: What is the browser/library/client you are using? What operating system and version?
    validations:
      required: true


================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"
    groups:
      github-actions:
        patterns: ["*"]
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "weekly"
    ignore:
      - dependency-name: "*"
        update-types:
          ["version-update:semver-patch", "version-update:semver-minor"]
    groups:
      npm:
        patterns: ["*"]


================================================
FILE: .github/workflows/docs.yaml
================================================
name: Verify Docs Formatting

on:
  push:
    branches:
      - main
  pull_request:

permissions:
  contents: read

jobs:
  markdown_tables:
    name: Check Markdown Tables
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v7

      - name: Install Node v20
        uses: actions/setup-node@v7
        with:
          node-version: 20
          cache: npm

      - name: Install dependencies
        run: npm ci

      - name: Check Markdown Tables
        id: lint
        run: npm run lint

      - name: Explain how to fix lint failures
        if: failure() && steps.lint.outcome == 'failure'
        run: |
          echo "::error title=Markdown tables are not formatted correctly::Run 'npm run fix:tables' from the tools/ directory and commit the changes. If the tables pass and this still fails, ESLint found problems in tools/; run 'npm run lint:fix' from the repo root."


================================================
FILE: .github/workflows/test.yaml
================================================
name: ci

on:
  push:
    branches:
      - main
  pull_request:

permissions:
  contents: read

jobs:
  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: 20
          cache: npm
      - run: npm ci
      - run: npm run lint
      - run: npm run -w tools build
  mdx:
    name: Validate mdx
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: 20
          cache: npm
      - run: npm ci
      - run: npm run -w tools test:build


================================================
FILE: .gitignore
================================================
.DS_Store
*.swp
node_modules/
dist/
.idea
xml_output/


================================================
FILE: .husky/pre-commit
================================================
# Ensure workspace dependencies are installed before linting.
# Installs only when node_modules is missing or package-lock.json has changed,
# so normal commits aren't slowed down.
if [ ! -d node_modules ] || [ package-lock.json -nt node_modules/.package-lock.json ]; then
  echo "husky - dependencies missing or out of date, running 'npm install'..."
  npm install || exit 1
fi

lint-staged


================================================
FILE: .mintignore
================================================
# Exclude directories
resources/
tools/

# Exclude specific files
LICENSE
LICENSE-CODE
CODE_OF_CONDUCT.md

# Include developers/resource
!developers/resources/

================================================
FILE: .vale.ini
================================================
# Top level styles
StylesPath = ./vale
MinAlertLevel = suggestion
IgnoredScopes = code, tt, img, url, a
SkippedScopes = script, style, pre, figure, code

# Vocabularies
Vocab = Mintlify, Discord

# This is required since Vale doesn't officially support MDX
[formats]
mdx = md

# MDX support
[*.mdx]
BasedOnStyles = Vale
Vale.Terms = NO # Enforces really harsh capitalization rules, keep off

# `import ...`, `export ...`
# `<Component ... />`
# `<Component>...</Component>`
# `{ ... }`
# Words with underscores
# Markdown links [text](url)
# Content within square brackets (markdown link text)
TokenIgnores = (?sm)((?:import|export) .+?$), \
(?<!`)(<\w+ ?.+ ?\/>)(?!`), \
(<[A-Z]\w+>.+?<\/[A-Z]\w+>), \
(\w*_\w*), \
(\[.+?\]\(.+?\)), \
(\[.+?\])

# Exclude:
# `<Component \n ... />`
BlockIgnores = (?sm)^(<\w+\n .*\s\/>)$, \
(?sm)^({.+.*})

CommentDelimiters = {/*, */}


================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Code of Conduct

## **Our Pledge**

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## **Our Standards**

Examples of behavior that contributes to a positive environment for our community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, hate speech, and personal or political attacks
- Public or private harassment
- Publishing others’ private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## **Enforcement Responsibilities**

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## **Scope**

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## **Enforcement**

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [https://dis.gd/contact](https://dis.gd/contact). All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## **Enforcement Guidelines**

Community leaders will follow the Community Impact Guidelines below in determining the consequences for any action they deem in violation of this Code of Conduct. We reserve the right to take a more severe enforcement action if a single violation is extremely egregious and harmful, for example: hate speech or threats of IRL violence.

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

## **Attribution**

This Code of Conduct is adapted from the **[Contributor Covenant](https://www.contributor-covenant.org/)**, version 2.1, available at **[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html)**.

Community Impact Guidelines were inspired by **[Mozilla’s code of conduct enforcement ladder](https://github.com/mozilla/diversity)**.

For answers to common questions about this code of conduct, see the FAQ at **[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq)**. Translations are available at **[https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations)**.


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing

See the [README](https://github.com/discord/discord-api-docs/blob/main/README.md) for licensing and legal information.

## Types of Changes

### Wanted Changes

1. Fixes to incorrect statements or inaccuracies within the documentation.
1. Rewording or extending documentation to clarify unclear wording or complicated explanations.
1. Additions that fill gaps or missing pieces in the current documentation.
1. Fixing of spelling and grammatical errors in the documentation.

### Unwanted Changes

1. Whitespace or formatting changes.
1. Subjective wording changes.
1. Modifications to the overall structure and format of the API docs.
1. Additions that replicate or needlessly restructure current documentation.
1. Additions that document unreleased product functionality.
1. Changes that modify [Community Resources](https://discord.com/developers/docs/topics/community-resources#community-resources) (see [guidelines](https://github.com/discord/discord-api-docs/discussions/4456) for more detail).

## Markdown Syntax

Our documentation uses standard [Markdown](https://www.markdownguide.org/basic-syntax/) syntax with some additional [MDX](https://mdxjs.com/) features.

We also support the following formatting from Mintlify:

- [Format Text](https://www.mintlify.com/docs/create/text)
- [Format Code](https://www.mintlify.com/docs/create/code)
- [Images & Embeds](https://www.mintlify.com/docs/create/image-embeds)
- [Files](https://www.mintlify.com/docs/create/files)
- [Lists & Tables](https://www.mintlify.com/docs/create/list-table)
- [Available Components](https://www.mintlify.com/docs/components/accordions)

================================================
FILE: LICENSE
================================================
Attribution-ShareAlike 4.0 International

=======================================================================

Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.

Using Creative Commons Public Licenses

Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.

     Considerations for licensors: Our public licenses are
     intended for use by those authorized to give the public
     permission to use material in ways otherwise restricted by
     copyright and certain other rights. Our licenses are
     irrevocable. Licensors should read and understand the terms
     and conditions of the license they choose before applying it.
     Licensors should also secure all rights necessary before
     applying our licenses so that the public can reuse the
     material as expected. Licensors should clearly mark any
     material not subject to the license. This includes other CC-
     licensed material, or material used under an exception or
     limitation to copyright. More considerations for licensors:
	wiki.creativecommons.org/Considerations_for_licensors

     Considerations for the public: By using one of our public
     licenses, a licensor grants the public permission to use the
     licensed material under specified terms and conditions. If
     the licensor's permission is not necessary for any reason--for
     example, because of any applicable exception or limitation to
     copyright--then that use is not regulated by the license. Our
     licenses grant only permissions under copyright and certain
     other rights that a licensor has authority to grant. Use of
     the licensed material may still be restricted for other
     reasons, including because others have copyright or other
     rights in the material. A licensor may make special requests,
     such as asking that all changes be marked or described.
     Although not required by our licenses, you are encouraged to
     respect those requests where reasonable. More_considerations
     for the public:
	wiki.creativecommons.org/Considerations_for_licensees

=======================================================================

Creative Commons Attribution-ShareAlike 4.0 International Public
License

By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-ShareAlike 4.0 International Public License ("Public
License"). To the extent this Public License may be interpreted as a
contract, You are granted the Licensed Rights in consideration of Your
acceptance of these terms and conditions, and the Licensor grants You
such rights in consideration of benefits the Licensor receives from
making the Licensed Material available under these terms and
conditions.


Section 1 -- Definitions.

  a. Adapted Material means material subject to Copyright and Similar
     Rights that is derived from or based upon the Licensed Material
     and in which the Licensed Material is translated, altered,
     arranged, transformed, or otherwise modified in a manner requiring
     permission under the Copyright and Similar Rights held by the
     Licensor. For purposes of this Public License, where the Licensed
     Material is a musical work, performance, or sound recording,
     Adapted Material is always produced where the Licensed Material is
     synched in timed relation with a moving image.

  b. Adapter's License means the license You apply to Your Copyright
     and Similar Rights in Your contributions to Adapted Material in
     accordance with the terms and conditions of this Public License.

  c. BY-SA Compatible License means a license listed at
     creativecommons.org/compatiblelicenses, approved by Creative
     Commons as essentially the equivalent of this Public License.

  d. Copyright and Similar Rights means copyright and/or similar rights
     closely related to copyright including, without limitation,
     performance, broadcast, sound recording, and Sui Generis Database
     Rights, without regard to how the rights are labeled or
     categorized. For purposes of this Public License, the rights
     specified in Section 2(b)(1)-(2) are not Copyright and Similar
     Rights.

  e. Effective Technological Measures means those measures that, in the
     absence of proper authority, may not be circumvented under laws
     fulfilling obligations under Article 11 of the WIPO Copyright
     Treaty adopted on December 20, 1996, and/or similar international
     agreements.

  f. Exceptions and Limitations means fair use, fair dealing, and/or
     any other exception or limitation to Copyright and Similar Rights
     that applies to Your use of the Licensed Material.

  g. License Elements means the license attributes listed in the name
     of a Creative Commons Public License. The License Elements of this
     Public License are Attribution and ShareAlike.

  h. Licensed Material means the artistic or literary work, database,
     or other material to which the Licensor applied this Public
     License.

  i. Licensed Rights means the rights granted to You subject to the
     terms and conditions of this Public License, which are limited to
     all Copyright and Similar Rights that apply to Your use of the
     Licensed Material and that the Licensor has authority to license.

  j. Licensor means the individual(s) or entity(ies) granting rights
     under this Public License.

  k. Share means to provide material to the public by any means or
     process that requires permission under the Licensed Rights, such
     as reproduction, public display, public performance, distribution,
     dissemination, communication, or importation, and to make material
     available to the public including in ways that members of the
     public may access the material from a place and at a time
     individually chosen by them.

  l. Sui Generis Database Rights means rights other than copyright
     resulting from Directive 96/9/EC of the European Parliament and of
     the Council of 11 March 1996 on the legal protection of databases,
     as amended and/or succeeded, as well as other essentially
     equivalent rights anywhere in the world.

  m. You means the individual or entity exercising the Licensed Rights
     under this Public License. Your has a corresponding meaning.


Section 2 -- Scope.

  a. License grant.

       1. Subject to the terms and conditions of this Public License,
          the Licensor hereby grants You a worldwide, royalty-free,
          non-sublicensable, non-exclusive, irrevocable license to
          exercise the Licensed Rights in the Licensed Material to:

            a. reproduce and Share the Licensed Material, in whole or
               in part; and

            b. produce, reproduce, and Share Adapted Material.

       2. Exceptions and Limitations. For the avoidance of doubt, where
          Exceptions and Limitations apply to Your use, this Public
          License does not apply, and You do not need to comply with
          its terms and conditions.

       3. Term. The term of this Public License is specified in Section
          6(a).

       4. Media and formats; technical modifications allowed. The
          Licensor authorizes You to exercise the Licensed Rights in
          all media and formats whether now known or hereafter created,
          and to make technical modifications necessary to do so. The
          Licensor waives and/or agrees not to assert any right or
          authority to forbid You from making technical modifications
          necessary to exercise the Licensed Rights, including
          technical modifications necessary to circumvent Effective
          Technological Measures. For purposes of this Public License,
          simply making modifications authorized by this Section 2(a)
          (4) never produces Adapted Material.

       5. Downstream recipients.

            a. Offer from the Licensor -- Licensed Material. Every
               recipient of the Licensed Material automatically
               receives an offer from the Licensor to exercise the
               Licensed Rights under the terms and conditions of this
               Public License.

            b. Additional offer from the Licensor -- Adapted Material.
               Every recipient of Adapted Material from You
               automatically receives an offer from the Licensor to
               exercise the Licensed Rights in the Adapted Material
               under the conditions of the Adapter's License You apply.

            c. No downstream restrictions. You may not offer or impose
               any additional or different terms or conditions on, or
               apply any Effective Technological Measures to, the
               Licensed Material if doing so restricts exercise of the
               Licensed Rights by any recipient of the Licensed
               Material.

       6. No endorsement. Nothing in this Public License constitutes or
          may be construed as permission to assert or imply that You
          are, or that Your use of the Licensed Material is, connected
          with, or sponsored, endorsed, or granted official status by,
          the Licensor or others designated to receive attribution as
          provided in Section 3(a)(1)(A)(i).

  b. Other rights.

       1. Moral rights, such as the right of integrity, are not
          licensed under this Public License, nor are publicity,
          privacy, and/or other similar personality rights; however, to
          the extent possible, the Licensor waives and/or agrees not to
          assert any such rights held by the Licensor to the limited
          extent necessary to allow You to exercise the Licensed
          Rights, but not otherwise.

       2. Patent and trademark rights are not licensed under this
          Public License.

       3. To the extent possible, the Licensor waives any right to
          collect royalties from You for the exercise of the Licensed
          Rights, whether directly or through a collecting society
          under any voluntary or waivable statutory or compulsory
          licensing scheme. In all other cases the Licensor expressly
          reserves any right to collect such royalties.


Section 3 -- License Conditions.

Your exercise of the Licensed Rights is expressly made subject to the
following conditions.

  a. Attribution.

       1. If You Share the Licensed Material (including in modified
          form), You must:

            a. retain the following if it is supplied by the Licensor
               with the Licensed Material:

                 i. identification of the creator(s) of the Licensed
                    Material and any others designated to receive
                    attribution, in any reasonable manner requested by
                    the Licensor (including by pseudonym if
                    designated);

                ii. a copyright notice;

               iii. a notice that refers to this Public License;

                iv. a notice that refers to the disclaimer of
                    warranties;

                 v. a URI or hyperlink to the Licensed Material to the
                    extent reasonably practicable;

            b. indicate if You modified the Licensed Material and
               retain an indication of any previous modifications; and

            c. indicate the Licensed Material is licensed under this
               Public License, and include the text of, or the URI or
               hyperlink to, this Public License.

       2. You may satisfy the conditions in Section 3(a)(1) in any
          reasonable manner based on the medium, means, and context in
          which You Share the Licensed Material. For example, it may be
          reasonable to satisfy the conditions by providing a URI or
          hyperlink to a resource that includes the required
          information.

       3. If requested by the Licensor, You must remove any of the
          information required by Section 3(a)(1)(A) to the extent
          reasonably practicable.

  b. ShareAlike.

     In addition to the conditions in Section 3(a), if You Share
     Adapted Material You produce, the following conditions also apply.

       1. The Adapter's License You apply must be a Creative Commons
          license with the same License Elements, this version or
          later, or a BY-SA Compatible License.

       2. You must include the text of, or the URI or hyperlink to, the
          Adapter's License You apply. You may satisfy this condition
          in any reasonable manner based on the medium, means, and
          context in which You Share Adapted Material.

       3. You may not offer or impose any additional or different terms
          or conditions on, or apply any Effective Technological
          Measures to, Adapted Material that restrict exercise of the
          rights granted under the Adapter's License You apply.


Section 4 -- Sui Generis Database Rights.

Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:

  a. for the avoidance of doubt, Section 2(a)(1) grants You the right
     to extract, reuse, reproduce, and Share all or a substantial
     portion of the contents of the database;

  b. if You include all or a substantial portion of the database
     contents in a database in which You have Sui Generis Database
     Rights, then the database in which You have Sui Generis Database
     Rights (but not its individual contents) is Adapted Material,

     including for purposes of Section 3(b); and
  c. You must comply with the conditions in Section 3(a) if You Share
     all or a substantial portion of the contents of the database.

For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.


Section 5 -- Disclaimer of Warranties and Limitation of Liability.

  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.

  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.

  c. The disclaimer of warranties and limitation of liability provided
     above shall be interpreted in a manner that, to the extent
     possible, most closely approximates an absolute disclaimer and
     waiver of all liability.


Section 6 -- Term and Termination.

  a. This Public License applies for the term of the Copyright and
     Similar Rights licensed here. However, if You fail to comply with
     this Public License, then Your rights under this Public License
     terminate automatically.

  b. Where Your right to use the Licensed Material has terminated under
     Section 6(a), it reinstates:

       1. automatically as of the date the violation is cured, provided
          it is cured within 30 days of Your discovery of the
          violation; or

       2. upon express reinstatement by the Licensor.

     For the avoidance of doubt, this Section 6(b) does not affect any
     right the Licensor may have to seek remedies for Your violations
     of this Public License.

  c. For the avoidance of doubt, the Licensor may also offer the
     Licensed Material under separate terms or conditions or stop
     distributing the Licensed Material at any time; however, doing so
     will not terminate this Public License.

  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
     License.


Section 7 -- Other Terms and Conditions.

  a. The Licensor shall not be bound by any additional or different
     terms or conditions communicated by You unless expressly agreed.

  b. Any arrangements, understandings, or agreements regarding the
     Licensed Material not stated herein are separate from and
     independent of the terms and conditions of this Public License.


Section 8 -- Interpretation.

  a. For the avoidance of doubt, this Public License does not, and
     shall not be interpreted to, reduce, limit, restrict, or impose
     conditions on any use of the Licensed Material that could lawfully
     be made without permission under this Public License.

  b. To the extent possible, if any provision of this Public License is
     deemed unenforceable, it shall be automatically reformed to the
     minimum extent necessary to make it enforceable. If the provision
     cannot be reformed, it shall be severed from this Public License
     without affecting the enforceability of the remaining terms and
     conditions.

  c. No term or condition of this Public License will be waived and no
     failure to comply consented to unless expressly agreed to by the
     Licensor.

  d. Nothing in this Public License constitutes or may be interpreted
     as a limitation upon, or waiver of, any privileges and immunities
     that apply to the Licensor or You, including from the legal
     processes of any jurisdiction or authority.


=======================================================================

Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.

Creative Commons may be contacted at creativecommons.org.


================================================
FILE: LICENSE-CODE
================================================
MIT License

Copyright (c) 2016 Discord

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

================================================
FILE: README.md
================================================
# Discord for Developers Documentation

This repo contains the official Discord for Developers documentation, which can be viewed online [HERE](https://docs.discord.com/developers/intro). Before submitting pull-requests, please remember to _fully_ read the [Contributing](CONTRIBUTING.md) guidelines.

This repository reflects the Discord Developer Platform as it is meant to be accessed by third-party applications. It omits features and capabilities that are not generally available, or are not fully supported for third-party usage.

We welcome your contributions!

-   Issue tracker: [Discord API bugs](https://github.com/discord/discord-api-docs/issues)
-   Discussions: [Discord API feature and improvement requests](https://github.com/discord/discord-api-docs/discussions/categories/api-feature-requests-ideas)
-   Pull Requests: See [Contributing.md](https://github.com/discord/discord-api-docs/blob/main/CONTRIBUTING.md) for types of changes accepted and specific markdown syntax used in the documentation.

### Local Preview

Install the [Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the documentation changes locally. To install, use the following command

```
npm i -g mintlify
```

Run the `mintlify dev` in the root directory to see your changes locally.

```
mintlify dev
```

Your local browser should open automatically to the correct page, but if not, navigate to:

```
http://localhost:3000/developers/intro
```

## Need some help?

Here are some Discord servers that can help you out with everything Discord API:

The [Official Discord Developers server](https://discord.gg/discord-developers) has plenty of help channels with knowledgeable people and Discord's developers to get you help with something you need, and get updates straight from the developers. However do keep in mind this is a purely on-topic server. If you are looking for a community, join the server below.

The [Unofficial Discord API server](https://discord.gg/discord-api) is a common hangout for library and bot developers alike. It's a great starting point for those looking to dive in and learn bot-creation with the Discord API.

## License

Except as otherwise noted, the Discord API Documentation and other content in this repository is licensed under the Creative Commons Attribution-ShareAlike 4.0 License (see [LICENSE](https://github.com/discord/discord-api-docs/blob/main/LICENSE)), and code samples in this repository are licensed under the MIT License (see [LICENSE-CODE](https://github.com/discord/discord-api-docs/blob/main/LICENSE-CODE)). These licenses do not grant you rights to use any of Discord’s trademarks or other brand features. Please see the [Discord Developer Terms of Service](https://support-dev.discord.com/hc/articles/8562894815383-Discord-Developer-Terms-of-Service) for more information about use of Discord’s brand features and APIs.


================================================
FILE: developers/activities/building-an-activity.mdx
================================================
---
title: Building Your First Activity in Discord
sidebarTitle: Build Your First Activity
description: Step-by-step tutorial for creating your first Discord Activity.
---

import {LinkButton} from '/snippets/linkbutton.jsx'

[Activities](/developers/activities/overview) are web-based games and apps that can be run within Discord. Activities are embedded in iframes within the Discord client, and can be launched from the App Launcher or when responding to interactions.

If this is your first time learning about Activities, check out the [Activities Overview](/developers/activities/overview) for more information and a collection of more advanced [sample projects](/developers/activities/overview#sample-projects).

## Introduction

In this guide, we'll be building a Discord app with a basic Activity that handles user authentication and fetches data using the API.

It assumes an understanding of [JavaScript](https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics) and [async functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function), and a basic understanding of frontend frameworks like [React](https://react.dev/) and [Vue](https://vuejs.org/). If you are still learning to program, there are many free education resources to explore like [The Odin Project](https://www.theodinproject.com/paths/foundations/courses/foundations), [Codecademy](https://www.codecademy.com/learn/paths/web-development), and [Khan Academy](https://www.khanacademy.org/computing/computer-programming/programming).

<Accordion title="What we'll be building" icon="eye">

![Building Your First Activity Tutorial](/images/activities/tutorial-hero.png)

</Accordion>

<Accordion title="Resources used in this guide" icon="list" defaultOpen>
- **[discord/getting-started-activity](https://github.com/discord/getting-started-activity)**, a project template to get you started
- **[@discord/embedded-app-sdk](https://github.com/discord/embedded-app-sdk)**, the SDK used to communicate between your app and Discord when building Activities
- **[Node.js](https://nodejs.org)**, latest version
- **[Express](https://expressjs.com)**, a popular JavaScript web framework we'll use to create a server to handle authentication and serve our app
- **[Vite](https://vite.dev/)**, a build tool for modern JavaScript projects that will make your application easier to serve
- **[cloudflared](https://github.com/cloudflare/cloudflared?tab=readme-ov-file#installing-cloudflared)**, for bridging your local development server to the internet
</Accordion>

---

## Step 0: Enable Developer Mode

Before getting started, you need to enable Developer Mode for your Discord account if you don't already have it enabled. Developer Mode will allow you to run in-development Activities and expose resource IDs (like users, channels, and servers) in the client which can simplify testing. To enable Developer Mode:
1. Go to your **User Settings** in your Discord client. On Desktop, you can access **User Settings** by clicking on the cogwheel icon near the bottom-left, next to your username.
2. Click on **Advanced** tab from the left-hand sidebar and toggle on `Developer Mode`.

## Step 1: Setting up the project

Before creating an app, let's set up our project code from the [`discord/getting-started-activity`](https://github.com/discord/getting-started-activity) repository.

Open a terminal window and clone the project code:

```
git clone git@github.com:discord/getting-started-activity.git
```

The sample project you cloned is broken into two parts:
- `client` is the sample Activity's frontend, built with vanilla JavaScript and integrated with [Vite](https://vitejs.dev/) to help with local development.
- `server` is a backend using vanilla JavaScript, Node.js, and Express. However, as you're building your own Activity, you can use whichever backend you prefer.

<Accordion title="Project structure" description="Overview of the project structure for the sample app used in this guide" icon="code">

```
├── client
├────── main.js       -> your Activity frontend
├────── index.html
├────── package.json
├────── rocket.png
├────── vite.config.js
├── server
├────── package.json
├────── server.js     -> your Activity backend
└── .env              -> your credentials, IDs and secrets
```

</Accordion>

### Install project dependencies

Before creating our Discord app, let's quickly install your project's frontend dependencies.

Navigate to your project folder's `client` directory, which is where all the sample Activity's frontend code lives:

```
cd getting-started-activity/client
```

Then install the project's dependencies and start up the frontend for the sample Activity:

```
# install project dependencies
npm install

# start frontend
npm run dev
```

If you visit http://localhost:5173/ you should see a vanilla JS frontend template running with [Vite](https://vitejs.dev/).

While it's not much at the moment, in the following steps we'll connect it to the backend services, make it runnable in Discord, and power it up by populating it with data we pull from Discord APIs.

<Accordion title="Step 1 Checkpoint" icon="list" defaultOpen>

By the end of Step 1, you should have:
- An understanding of what Discord [Activities](/developers/activities/overview) are
- Developer Mode enabled on your Discord account
- Cloned the [sample project](https://github.com/discord/getting-started-activity) to your development environment
- Installed the front-end dependencies (in the `client` folder)
</Accordion>

---

## Step 2: Creating an app

With our project set up, let's create our app and configure the Activity. Create a new app in the developer portal if you don't have one already:

<LinkButton to="https://discord.com/developers/applications?new_application=true" color="brand">Create App</LinkButton>

Enter a name for your app, select a development team, then press **Create**.

<Info>
**Development Team Access**

Launching a non-distributed Activity is limited to you or members of the developer team, so if you're collaborating with others during development, create a [developer team](https://discord.com/developers/teams) and set it to the owner when you create the app.
</Info>

After you create your app, you'll land on the **General Information** page of the app's settings, where you can update basic information about your app like its description and icon.

### Choose installation contexts

Apps in Discord can be installed to different **[installation contexts](/developers/resources/application#installation-context)**: servers, user accounts, or both.

The recommended *and* default behavior for apps is supporting both installation contexts, which lets the installer to choose the context during the installation flow. However, you can change the default behavior by changing the supported installation contexts in your app's settings.

<Accordion title="Why do installation contexts matter?" description="Overview of where apps can be installed">

As mentioned, installation contexts determine where your app can be installed. The installation context affect things like who can manage the installation, where the app's commands can appear, and the data returned in response to interactions.

- Apps installed in a **[server context](/developers/resources/application#server-context)** (server-installed apps) must be authorized by a server member with the `MANAGE_GUILD` permission, and are visible to all members of the server.
- Apps installed in a **[user context](/developers/resources/application#user-context)** (user-installed apps) are visible only to the authorizing user, and therefore don't require any server-specific permissions. Apps installed to a user context are visible across all of the user's servers, DMs, and GDMs—however, they're limited to using commands.

Details about installation contexts is in the [Application documentation](/developers/resources/application#installation-context) and the [Developing a User-Installable App tutorial](/developers/tutorials/developing-a-user-installable-app).
</Accordion>

Click on [**Installation**](https://discord.com/developers/applications/select/installation) in the left sidebar, then under **Installation Contexts** make sure both "User Install" and "Guild Install" are selected. This will make sure users can launch our app's Activity across Discord servers, DMs, and Group DMs.

### Add a Redirect URI

Next, we'll add a Redirect URI, which is where a user is typically redirected to after authorizing with your app when going through the standard OAuth flow. While setting up a Redirect URI is required, the Embedded App SDK automatically handles redirecting users back to your Activity when the RPC [`authorize` command](/developers/developer-tools/embedded-app-sdk#authorize) is called.

You can learn more about the OAuth flow and redirect URIs in the [OAuth2 documentation](/developers/topics/oauth2), but since we're only authorizing in an Activity, we'll just use a placeholder value (`https://127.0.0.1`) and let the Embedded App SDK handle the rest.

Click on [**OAuth2**](https://discord.com/developers/applications/select/oauth2) in your app's settings. Under **Redirects**, enter `https://127.0.0.1` as a placeholder value then click **Save Changes**.

![Redirect URI in Activity Settings](/images/activities/oauth2-redirect.png)

### Fetch Your OAuth2 Credentials

To use information related to a user (like their username) or a server (like the server's avatar), your app must be granted specific OAuth **scopes**.

For our sample app, we'll be requesting three scopes: `identify` to access basic information about a user, `guilds` to access basic information about the servers a user is in, and `applications.commands` to install [commands](/developers/interactions/overview#commands). We'll request these later on in the guide, but a full list of scopes you can request is in the [OAuth2 documentation](/developers/topics/oauth2#shared-resources-oauth2-scopes).

When requesting scopes later on, you'll need to pass your app's OAuth2 identifiers. For now, we'll copy these identifiers into your project's environment file.

In the root of your project, there is an `example.env` file. From the root of your project, run the following to copy it into a new `.env` file:

```
cp example.env .env
```

<Warning>
**Secure Your Secrets**

Your `DISCORD_CLIENT_SECRET` and `DISCORD_BOT_TOKEN` are *highly* sensitive secrets. Never share either secrets or check them into any kind of version control.
</Warning>

Back in your app's settings, click on [**OAuth2**](https://discord.com/developers/applications/select/oauth2):
1. **Client ID**: Copy the value for Client ID and add it to your `.env` file as **`VITE_CLIENT_ID`**. This is the public ID that Discord associates with your app, and is almost always the same as your App ID.
2. **Client Secret**: Copy the value for Client Secret and add it to your `.env` as **`DISCORD_CLIENT_SECRET`**. This is a private, sensitive identifier that your app will use to grant an OAuth2 `access_token`, and should never be shared or checked into version control.

<Info>
**Why is there a VITE_ prefix before our Client ID?**

Prefixing the `CLIENT_ID` environment variable with `VITE_` makes it accessible to our client-side code. This security measure ensures that only the variables you intend to be accessible in the browser are available, and all other environment variables remain private. You can read details in the [Vite documentation](https://vitejs.dev/guide/env-and-mode).
</Info>

<Accordion title="Step 2 Checkpoint" icon="list" defaultOpen>

By the end of Step 2, make sure you have:
- Set up a placeholder Redirect URI
- Added your app's Client ID and Client Secret to your project's `.env` file.
</Accordion>

## Step 3: Setting Up the Embedded App SDK

With our project and app set up, we're going to install and configure the [Embedded App SDK](/developers/developer-tools/embedded-app-sdk) which we'll use extensively through the rest of this guide.

The Embedded App SDK is a first-party SDK that handles the communication between Discord and your Activity with [commands](/developers/developer-tools/embedded-app-sdk#sdk-commands) to interact with the Discord client (like fetching information about the channel) and [events](/developers/developer-tools/embedded-app-sdk#sdk-events) to listen for user actions and changes in state (like when a user starts or stops speaking).

<Info>
The events and commands available in the Embedded App SDK are a subset of the [RPC API](/developers/topics/rpc) ones, so referencing the RPC documentation can be helpful to understand what's happening under the hood when developing Activities.
</Info>

### Install the SDK

Back in our project's `client` directory from before (`getting-started-activity/client`), install the Embedded App SDK [via NPM](https://www.npmjs.com/package/@discord/embedded-app-sdk):

```
npm install @discord/embedded-app-sdk
```

This will add `@discord/embedded-app-sdk` to `getting-started-activity/client/package.json` and install the SDK in your `node_modules` folder.

### Import the SDK in your Project

Once installed, we need to import it into our client code and instantiate it to start the handshake between our app and the Discord client.

To instantiate the SDK, we will use the environment variables we set up in Step 2.

We also set up a check for the [`ready` event](/developers/developer-tools/embedded-app-sdk#ready) with an async/await function which allows us to output a log or perform other actions once the handshake was successful.

<Accordion title="Add SDK initialization to frontend" description="Code for adding the Embedded App SDK" icon="code" defaultdefaultOpen>

In `getting-started-activity/client/main.js`, let's import and instantiate the SDK:

```js
// Import the SDK
import { DiscordSDK } from "@discord/embedded-app-sdk";

import "./style.css";
import rocketLogo from '/rocket.png';

// Instantiate the SDK
const discordSdk = new DiscordSDK(import.meta.env.VITE_DISCORD_CLIENT_ID);

setupDiscordSdk().then(() => {
  console.log("Discord SDK is ready");
});

async function setupDiscordSdk() {
  await discordSdk.ready();
}

document.querySelector('#app').innerHTML = `
  <div>
    <img src="${rocketLogo}" class="logo" alt="Discord" />
    <h1>Hello, World!</h1>
  </div>
`;
```

</Accordion>

<Warning>
**Time to leave your browser behind**

Once you add the SDK to your app, you will *not* be able to view your app inside your web browser. In the next step, we will run your Activity inside of Discord. In the next step, we will go over how to view your app in Discord.
</Warning>

<Accordion title="Step 3 Checkpoint" icon="list" defaultOpen>

By the end of Step 3, make sure you have:
- Installed the Embedded App SDK to your project
- Imported the SDK in your project's `client/main.js` file
</Accordion>


---

## Step 4: Running your app in Discord

Let's ensure everything is wired up correctly, enable activities via the dev portal, and then run the Activity in Discord.

### Run your app

First, we'll restart the sample app. Open a terminal window and navigate to your project directory's `client` folder, then start the client-side app:

```
cd client
npm run dev
```

Your app should start and you should see output similar to the following:

```
VITE v5.0.12  ready in 100 ms

➜  Local:   http://localhost:5173/
➜  Network: use --host to expose
➜  press h + enter to show help
```

We'll use the Local URL as our publicly-accessible URL in the next step.

### Set up a public endpoint

Next, we'll need to set up the public endpoint that serves the Activity's frontend. To do that, we'll create a tunnel with a reverse proxy. While we'll be using [`cloudflared`](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/) in this guide, you can use [ngrok](https://ngrok.com/docs) or another reverse proxy solution if you prefer.

While your app is still running, open another terminal window and start a network tunnel that listens to the port from the last step (in this case, port `5173`):

```
cloudflared tunnel --url http://localhost:5173
```

When you run `cloudflared`, the tunnel will generate a public URL and you'll see output similar to the following:

```
Your quick Tunnel has been created! Visit it at (it may take some time to be reachable):
https://funky-jogging-bunny.trycloudflare.com
```

Copy the URL from the output, as we'll need to add it to our app's settings.

### Set up your Activity URL Mapping

Because Activities are in a sandbox environment and go through the Discord proxy, you'll need to add a public URL mapping to serve your application and make external requests in your Activity. Since we're developing locally, we'll use the public endpoint we just set up.

Back in your app's settings, click on the [**URL Mappings** page](https://discord.com/developers/applications/select/embedded/url-mappings) under **Activities** on the left-hand sidebar. Enter the URL you generated from `cloudflared` in the previous step.

![Configuring your URL Mapping](/images/activities/url-mapping-tutorial.png)

| PREFIX | TARGET                                  |
|--------|-----------------------------------------|
| `/`    | `funky-jogging-bunny.trycloudflare.com` |

Read details about URL Mapping [in the development guide](/developers/activities/development-guides/local-development#url-mapping).

### Enable Activities

Next, we'll need to enable Activities for your app. On the left hand sidebar under **Activities**, click [**Settings**](https://discord.com/developers/applications/select/embedded/settings).

Find the first checkbox, labeled `Enable Activities`. Turn it on 🎉

![Enabling Activities in Settings](/images/activities/enable-activities.png)

#### Default Entry Point Command

When you enable Activities for your app, a [default Entry Point command](/developers/interactions/application-commands#default-entry-point-command) called "Launch" is automatically created. This [Entry Point command](/developers/interactions/application-commands#entry-point-commands) is the primary way for users to launch your Activity in Discord.

By default, interactions with this command will result in Discord opening your Activity for the user and posting a message in the channel where it was launched from. However, if you prefer to handle the interactions in your app, you can update the [`handler` field](/developers/interactions/application-commands#entry-point-handlers) or create your own. Additional details are in the Entry Point command [documentation](/developers/interactions/application-commands#entry-point-commands) and [development guide](/developers/activities/development-guides/user-actions#setting-up-an-entry-point-command).


### Running your Activity in Discord

Now that we are pointing Discord to our locally running app, we can launch the Activity in Discord!

Navigate to your Discord test server and, in any voice and or text channel, open the App Launcher where your in-development Activity should be present. If you don't see your Activity, you should try searching for its name.

Clicking on your app will launch your locally running app from inside Discord!

![Running your activity](/images/activities/start-activity.png)

<Info>
**Customizing your Activity**

If you'd like to set images for your Activity, you can learn how to do that [here](/developers/activities/development-guides/assets-and-metadata#setting-up-activity-metadata).
</Info>

We're looking pretty good so far, but we haven't wired up any Discord functionality yet. Let's do that next.

<Accordion title="Step 4 Checkpoint" icon="list" defaultOpen>

By the end of Step 4, make sure you have:
- Set up a public endpoint
- Added an Activity URL Mapping in your app's settings
- Enabled Activities for your app
- Successfully launched your Activity in Discord
</Accordion>

---

## Step 5: Authorizing & authenticating users

To authenticate your Activity with the users playing it, we must finish implementing our server-side app and get it talking to the client-side app.

We will use `express` for this example, but any backend language or framework will work here.

<Accordion title="OAuth2 Flow Diagram" icon="eye">

This diagram illustrates the common pattern for granting a user an OAuth2 access_token:

![Flow diagram for Oauth2](/images/activities/oauth-flow-diagram.svg)

We will be implementing this pattern in this tutorial, but more example implementations can also be found in this sample project:

- [Back-end code](https://github.com/discord/embedded-app-sdk-examples/blob/main/discord-activity-starter/packages/server/src/app.ts)
- [Front-end code](https://github.com/discord/embedded-app-sdk-examples/blob/main/discord-activity-starter/packages/client/src/main.ts)

</Accordion>

```
# move into our server directory
cd server

# install dependencies
npm install
```

We aren't going to edit the server code here, but it consists of a single POST route for `/api/token` that allows us to perform the OAuth2 flow from the server securely.

<Accordion title="getting-started-activity/server/server.js" icon="eye">

In the `getting-started-activity/server/server.js` file, the following code should already be present:

```javascript
import express from "express";
import dotenv from "dotenv";
import fetch from "node-fetch";
dotenv.config({ path: "../.env" });

const app = express();
const port = 3001;

// Allow express to parse JSON bodies
app.use(express.json());

app.post("/api/token", async (req, res) => {

  // Exchange the code for an access_token
  const response = await fetch(`https://discord.com/api/oauth2/token`, {
    method: "POST",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    body: new URLSearchParams({
      client_id: process.env.VITE_DISCORD_CLIENT_ID,
      client_secret: process.env.DISCORD_CLIENT_SECRET,
      grant_type: "authorization_code",
      code: req.body.code,
    }),
  });

  // Retrieve the access_token from the response
  const { access_token } = await response.json();

  // Return the access_token to our client as { access_token: "..."}
  res.send({access_token});
});

app.listen(port, () => {
  console.log(`Server listening at http://localhost:${port}`);
});
```
</Accordion>

Now, start the project's backend server:

```
npm run dev
```

You should output similar to the following:

```
> server@1.0.0 dev
> node server.js

Server listening at http://localhost:3001
```

We can now run our server and client-side apps in separate terminal windows. You can see other ways to set this up in the other [sample projects](/developers/activities/overview#sample-projects).

### Calling external resources from your activity

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.

Learn more about this topic in the guides for [Constructing a Full URL](/developers/activities/development-guides/networking#construct-a-full-url) and [Using External Resources](/developers/activities/development-guides/networking#using-external-resources).

### Calling your backend server from your client

We're almost there! Now, we need our client application to communicate with our server so we can start the OAuth process and get an access token.

<Info>
**What is vite.config.js?**

To allow our frontend app to call our Express server, Vite requires us to set up a proxy for `/api/*` to our backend server, which is running on port 3001. In their docs, you can learn more about [Vite](https://vitejs.dev/).
</Info>

<Accordion title="Calling the backend server" description="Code for authorizing and authenticating" icon="code" defaultOpen>

Copy the following code in your project's `getting-started-activity/client/main.js` file:

```javascript
import { DiscordSDK } from "@discord/embedded-app-sdk";

import rocketLogo from '/rocket.png';
import "./style.css";

// Will eventually store the authenticated user's access_token
let auth;

const discordSdk = new DiscordSDK(import.meta.env.VITE_DISCORD_CLIENT_ID);

setupDiscordSdk().then(() => {
  console.log("Discord SDK is authenticated");

  // We can now make API calls within the scopes we requested in setupDiscordSDK()
  // Note: the access_token returned is a sensitive secret and should be treated as such
});

async function setupDiscordSdk() {
  await discordSdk.ready();
  console.log("Discord SDK is ready");

  // Authorize with Discord Client
  const { code } = await discordSdk.commands.authorize({
    client_id: import.meta.env.VITE_DISCORD_CLIENT_ID,
    response_type: "code",
    state: "",
    prompt: "none",
    scope: [
      "identify",
      "guilds",
      "applications.commands"
    ],
  });

  // Retrieve an access_token from your activity's server
  const response = await fetch("/api/token", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      code,
    }),
  });
  const { access_token } = await response.json();

  // Authenticate with Discord client (using the access_token)
  auth = await discordSdk.commands.authenticate({
    access_token,
  });

  if (auth == null) {
    throw new Error("Authenticate command failed");
  }
}

document.querySelector('#app').innerHTML = `
  <div>
    <img src="${rocketLogo}" class="logo" alt="Discord" />
    <h1>Hello, World!</h1>
  </div>
`;
```
</Accordion>

Now if we relaunch our app, we'll be prompted to authorize with Discord using the `identify`, `guilds`, and `applications.commands` scopes.

![Prompt to authorize Activity](/images/activities/tutorial-auth.png)

<Warning>
**Safe storage of tokens**

Access tokens and refresh tokens are powerful, and should be treated similarly to passwords or other highly-sensitive data. Store both types of tokens securely and in an encrypted manner.
</Warning>

<Accordion title="Step 5 Checkpoint" icon="list" defaultOpen>

By the end of Step 5, make sure you have:
- Updated your `client/main.js` to call the backend to support user authorization and authentication
- Been able to successfully complete the authorization flow for your app when opening your Activity
</Accordion>

---

## Step 6: Use the SDK to fetch the channel

Now that we have authenticated our users, we can start interacting with contextual Discord information that we can use in our application.

Let's use the SDK to get details about the channel that our activity is running in. We can do this by writing a new async function that uses the `commands.getChannel` SDK method.

<Accordion title="Fetching a channel using the SDK" icon="code" defaultOpen>

In the same `getting-started-activity/client/main.js` file, paste the following function:

```javascript
async function appendVoiceChannelName() {
  const app = document.querySelector('#app');

  let activityChannelName = 'Unknown';

  // Requesting the channel in GDMs (when the guild ID is null) requires
  // the dm_channels.read scope which requires Discord approval.
  if (discordSdk.channelId != null && discordSdk.guildId != null) {
    // Over RPC collect info about the channel
    const channel = await discordSdk.commands.getChannel({channel_id: discordSdk.channelId});
    if (channel.name != null) {
      activityChannelName = channel.name;
    }
  }

  // Update the UI with the name of the current voice channel
  const textTagString = `Activity Channel: "${activityChannelName}"`;
  const textTag = document.createElement('p');
  textTag.textContent = textTagString;
  app.appendChild(textTag);
}
```

Now, update the callback after `setupDiscordSdk()` to call the function you just added:

```javascript
setupDiscordSdk().then(() => {
  console.log("Discord SDK is authenticated");

  appendVoiceChannelName();
});
```

</Accordion>

If you close and rejoin the Activity, you should now see the name of the current channel.

![Discord Activities](/images/activities/tutorial-channel-name.png)

<Accordion title="Step 6 Checkpoint" icon="list" defaultOpen>

By the end of Step 6, make sure you have:
- Updated your `client/main.js` code to fetch the channel name using the SDK
- Added a call to the new function in the callback for `setupDiscordSdk()`
</Accordion>

---

## Step 7: Use the API to fetch the guild

Since we requested the `identify` and `guilds` scopes, you can also use the authorized `access_token` we received earlier to fetch those resources via the API.

In the following code block, we will:
1. Call the [`GET /users/@me/guilds`](/developers/resources/user#get-current-user-guilds) endpoint with `auth.access_token` to get a list of the guilds the authorizing user is in
2. Iterate over each guild to find the guild we are in based on the `guildId` defined in discordSdk
3. Create a new HTML image element with the guild avatar and append it to our frontend

<Info>
In this example, we use a pure `fetch` request to make the API call, but you can us one of the JavaScript [community-built libraries](/developers/developer-tools/community-resources) if you prefer.
</Info>

<Accordion title="Fetching information about the current server" icon="code" defaultOpen>

In the same `client/main.js` file, add the following function:

```javascript
async function appendGuildAvatar() {
  const app = document.querySelector('#app');

  // 1. From the HTTP API fetch a list of all of the user's guilds
  const guilds = await fetch(`https://discord.com/api/v10/users/@me/guilds`, {
    headers: {
      // NOTE: we're using the access_token provided by the "authenticate" command
      Authorization: `Bearer ${auth.access_token}`,
      'Content-Type': 'application/json',
    },
  }).then((response) => response.json());

  // 2. Find the current guild's info, including it's "icon"
  const currentGuild = guilds.find((g) => g.id === discordSdk.guildId);

  // 3. Append to the UI an img tag with the related information
  if (currentGuild != null) {
    const guildImg = document.createElement('img');
    guildImg.setAttribute(
      'src',
      // More info on image formatting here: https://docs.discord.com/developers/reference#image-formatting
      `https://cdn.discordapp.com/icons/${currentGuild.id}/${currentGuild.icon}.webp?size=128`
    );
    guildImg.setAttribute('width', '128px');
    guildImg.setAttribute('height', '128px');
    guildImg.setAttribute('style', 'border-radius: 50%;');
    app.appendChild(guildImg);
  }
}
```

Then, call the new function in the callback for `setupDiscordSdk`:

```javascript
setupDiscordSdk().then(() => {
  console.log("Discord SDK is authenticated");

  appendVoiceChannelName();
  appendGuildAvatar();
});
```
</Accordion>

If we relaunch our Activity, we will see the current server's avatar render in our Activity.

![Discord Activities](/images/activities/tutorial-hero.png)

<Accordion title="Step 7 Checkpoint" icon="list" defaultOpen>

At this point, you should have your Activity up and running. For Step 7, you should have:
- Updated your `client/main.js` code to fetch the guild information using the [`GET /users/@me/guilds`](/developers/resources/user#get-current-user-guilds) API endpoint
- Added a call to the new function in the callback for `setupDiscordSdk()`
</Accordion>

---

## Next Steps

Congrats on building your first Activity! 🎉

This is an intentionally simple example to get you started with the communication between your Activity and Discord using the Embedded App SDK and APIs. From here, you can explore the [Activities documentation](/developers/activities/overview) and other resources.

import {WrenchIcon} from '/snippets/icons/WrenchIcon.jsx'
import {ForumIcon} from '/snippets/icons/ForumIcon.jsx'
import {GlobeEarthIcon} from '/snippets/icons/GlobeEarthIcon.jsx'

<CardGroup cols={3}>
  <Card title="Development Guides" href="/developers/developer-tools/community-resources" icon={<WrenchIcon />}>
    Follow our Activities Development Guides for suggested development practices and considerations.
  </Card>
  <Card title="Sample Activity Projects" href="https://github.com/discord/embedded-app-sdk-examples" icon={<ForumIcon />}>
     Try out the full range of Embedded App SDK features in the playground app, or explore some of the other examples
  </Card>
  <Card title="Discord Developers" href="https://discord.gg/discord-developers" icon={<GlobeEarthIcon />}>
    Join our community to ask questions about the API, attend events hosted by the Discord platform team, and interact with other Activities developers
  </Card>
</CardGroup>


================================================
FILE: developers/activities/design-patterns.mdx
================================================
---
title: Activity Design Patterns
sidebarTitle: Design Patterns
description: Best practices and design principles for creating engaging Discord Activities.
---

import {ManualAnchor} from '/snippets/manualanchor.jsx'

Before building your Activity, here are some guiding principles for you to consider for a successful user experience.

## Guiding Principles

### Interaction over Isolation
- Activities are not for screen-sharing, we already have that built-in!
- Give users a way to interact with one another.
- User actions should impact the experiences of other participants.

### Expression over Monotony
- Our users want to create memorable moments.
- Create experiences where users craft moments and react in ways they want to share with others.

### Accessibility over Exclusion
- Inclusivity is key. 
- Reduce the bar to entry for your Activity and reward people for engaging deeply with your experience.

---

## Providing a "Solo-Plus" Experience

Successful experiences will be built to accommodate small group sessions ("Plus"), but also playable and enjoyable for the case of single-player ("Solo") sessions.

### Solo or single-player
- While most people use Discord with small groups of friends. Consider experiences that are compelling alone, but better together!
- If you don't support solo play, expect to see a lot of users peeking into the Activity on their own. Consider what you can do to preview the Activity and compel them to come back with their friends.

### Solo-Plus or small groups of users
- Small group sessions (3-8 people) show more engagement and retention from users than single-player experiences.
- Letting players join with their friends keeps them coming back for more.

### Large groups of users
- While you can set a "max participants" suggestion to users, the only real limit is the number of people who can join a Voice call.
- Be aware of how your Activity will behave when there are 25 or more people in the call.

---

## User Presence & Privacy
When in an Activity with others, make the actions and presence of the others visible to each player. 

### Make actions and presence of the others visible to each player
    - Users enjoy participating in a space that feels active.
    - If a user has customized their server nickname or avatar, use their server nickname or avatar in game.
    - Show when a user is speaking in the voice call, or whether they're active or inactive.

![Speech bubbles in Bobble League](/images/activities/bobble-bash.png)

### Respect user privacy
    - For Activity sessions that match users from various servers, usernames and avatars should be anonymized by default.
    - Discord personal identifiers should only be populated into the Activity with user confirmation.
    - Only use these identifiers when the people who can see them already have access via the server or DM.

---

## Deliver a Quality Experience

Make your app fast, easy to join, and maximize fun to launch a crowd favorite.

### Surprise and delight users
- Surprise and delight is about caring about the small details of how a person experiences your work.
- Put the right emotion in when they least expect it to deliver the magic.

![Bobble League](/images/activities/bobble-league.png)

### Keep load times as low as possible
- This allows for easier drop-in drop-out behavior for the large portion of mobile users on Discord.
- See the below [Quality & Testing Recommendations](/developers/activities/design-patterns#quality-and-testing) for key areas of minimum quality support and testing recommendations.
- See the below [Technical Considerations](/developers/activities/design-patterns#technical-considerations) for recommendations on how to partition loading and work with various development tools to reduce load times.
- Consider different screen sizes and orientations across desktop and mobile devices and make sure UI elements scale appropriately.

### Support drop-in, drop-out behavior

- 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.
- 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.

![Support drop-in, drop-out behavior in your Activity](/images/activities/eights.png)

### Make your app as available as possible

#### Cross-Platform Support
- Supporting desktop and mobile devices will expand your user-base to the widest number of users.
- Discord device usage is split between mobile and desktop platforms.

#### Discord is a Global Audience
    - Consider supporting a multitude of languages and cultures to make your app more usable for all Discord users.

#### Implement Invites
- The Embedded App SDK allows for sending invites from within an Activity out to other friended users.
- Add invite buttons to a screen or flow with intentionality, not only on the start screen and at the beginning. Examples of intentional Invite prompting include:
    - Cases where players leave the activity session
    - Cases where the minimum number of participants has not been reached (e.g. any activity that needs 2+ to start, or is more fun with more people, or when you need an opponent in a game like Chess.)

#### Implement Sharing

Discord is a social platform where users talk to each other. Sharing and invites lets your app live and engage in those shared spaces, making it visible and accessible to everyone not currently playing. Things like sharing and invites are important ways to reach into those private, shared spaces and attract other players.

- The Embedded App SDK allows for sending an image or gif from within an Activity.
    - 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.
    - 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.
    
![Shared Moment from Chess in the Park](/images/activities/chess-victory.png)

#### Activities in Text Channels
- 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. 
- All controls, CTAs, and instructions should be clear enough that folks (especially first time users) playing in a text channel are able to quickly start using the app without needing to talk on voice to learn about it.
- Lean on dynamic first-time user experience and "How To Play" instructions, toast messages, Call To Action buttons, etc. but be careful to not over-clutter with copy.

### Monetization Considerations

<Check>
Monetization in Activities will be available soon. Keep the following considerations in mind as you design your Activity.
</Check>

- Avoid prohibitive gates in front of participation (e.g. login wall / paywall), especially early in the user journey.
- Avoid monetized unlocks that give unfair advantage to other non-paying players or users (i.e. "pay to win").
- Take advantage of Discord as a social platform: look for opportunities to offer users customizable skins, aesthetic themes, new avatars, etc.

---

## Game Design Considerations

### Build games that are easy to learn, hard to master
- Players can often feel pressure when joining a multiplayer game (voice/video) in the moment if they’ve never played before.
- Games that have a simple quick reference control scheme that are easily approachable help ease players into an experience without dropping them into the deep end.
- An easy to understand game loop combined with easy to digest controls tends to work best. If you have to go through a tutorial to understand the game then it will be intimidating to join a game in the moment.

### Discord users who engage with voice are among our most engaged users
-  Activity engagement and retention increases when users are in a voice call with friends.

### Consider existing game expectations and tropes
- If you're developing a game, you're more likely to attract users who are gamers.
- Take advantage of existing tropes and expectations for games of the genre you're developing.
- Appeal to the player interests that your game (or game genre) provides, and support those interests as a means to get them coming back.

### Activities close when the last participant in the Activity leaves it
- The next time the Activity is launched, even if it’s in the same DM or Voice Channel, it will be a different instance and could have different participants.

<ManualAnchor id="if-a-game-is-launched-what-%-of-the-time-do-users-reach-different-phases-of-the-game" />
### If a game is launched, what % of the time do users reach different phases of the game?
- This includes launch → start, as there can be a large dropoff between these two (especially if you don’t support solo play or small group sizes).
- This also includes various check points in the game, including what % of sessions that start a game reach the end of that game!
- If your Activity has different settings you can start a game with, see if some are more popular or more successful — you may want to change your defaults!
    - For non-games, you may want to analyze a certain action instead (such as queueing a video / song for a co-watching / co-listening Activity).
- If drop-off is really high at a certain point, see if you can figure out why or change flows.

<ManualAnchor id="how-many-games-are-played-in-a-session" />
### How many games are played in a session?
- More games per session isn’t inherently better (you may have an Activity that is meant to be one long game), but is a good baseline to understand.
- If you expect to see a lot of repeat plays per session and don’t, it can be worth digging in to understand more.

<ManualAnchor id="how-does-the-group-size-impact-various-key-metrics" />
### How does the group size impact various key metrics?
- For example, are larger sessions more or less likely to reach the end of a game? To replay? Etc.
- This can help you catch if your Activity has unexpected weak points in different group sizes — maybe the game drags on if there are too many people or isn’t compelling enough if there’s only two.
- Not every Activity needs to be built for robust group sizes, but if you have the option to play with X # of players, it’s good practice to make sure that experience is enjoyable for all involved!

---

## Co-Watching / Co-Listening

- Co-watching and co-listening should be more than just screen-sharing. Consider creative ways to make each user's experience impacted by other participants.
- Consider providing host-controls so that playback isn't overly chaotic. If host controls are provided, make sure everyone can participate in some way, even if it's just recommending content to the host.
- If content is not available for everyone in the activity (for example, geo-restricted content), make sure that information is known when the content is queued and when it's playing. The host is generally interested in creating a good experience for their friends. Playback of content should be in sync with others in a local channel or call.
- Familiar design patterns can help to get people to participate in your Activity right away. Most Discord users are extremely familiar with media browsing (Spotify, YouTube, Netflix, etc.) and will immediately understand your content if you follow these patterns.
- Mobile device volume can be controlled by a device's built-in controls (volume buttons on the side of the device) and work as expected across desktop, mobile, and browsers.

---

## Technical Considerations

### Developing for the iframe

- Remember that you need to contend with the Discord Client itself for resources (CPU, RAM and GPU) as that client is still fully running while executing your Activity.
- Prioritize time-to-first-interaction.
- Minimize the amount of Web Assembly (WASM) as much as possible in your Activity.
    - Older iOS devices are especially affected by WebKit's optimization compilation pass of WASM that occurs during the first few minutes of usage of an Activity. To varying degrees, this will cause noticeable stutters, device thermal issues, and possibly degraded Discord's AV quality during those early minutes.
- All network traffic is routed through the Discord Proxy for various security reasons.
- Create multiple versions of your Activity in the Developer Portal for less and more stable development versioning (e.g. Development, Staging, Production). This allows you to show and test the last stable build while also having development and staging environments.

### Developing in Unity

Developing for the iframe in Unity is possible, but will likely require extensive min/maxing of all facets of your game to meet performance and quality standards. Other, web-first, game engines are generally more performant out of the box.

---

## Quality and Testing

### Verify User Interface and User Experience
- Ensure all buttons and UI elements function correctly without any blocking issues for standard Activity use or gameplay. 
- Test Discord usernames handling, ensuring they display appropriately based on the chosen format (Discord username or server identity).

### Test for Performance
- Evaluate performance to ensure it is satisfactory for the majority of users across phones, tablets, and desktop machines and across multiple operating systems. 
- Lag or slowness should not significantly impact the Activity or gameplay experience.

### Test for Audio
- Check that sound effects and background music work as intended, with volume settings functioning correctly.
- Being able to hear when playing on a voice call is important.

### Validate Activity Controls
- Confirm that all game controls, including clicks, drag, key controls, swiping, and hovers, work as expected and are suitable for the platform.
- Test in-app tutorials and instructions for accuracy and relevance to the current activity functionality and user platform (desktop or mobile).

### Mobile Device UI Considerations
- Watch out for potential issues on devices with top notches or cameras in specific corners that may hide or cut off UI elements and buttons, rendering them untappable.
- Be mindful of Android curved screen edges that could obscure or make elements and buttons inaccessible.
- Take into account iOS/Android swipe gestures that may interfere with UI elements or buttons located at the bottom of the screen.
- Ensure that Android devices with a back button do not overlap with elements or buttons at the bottom of the screen, preventing users from tapping them.
- Respect the safe area defined by the platform to prevent any buttons or content from being cut off or non-functional.

### Desktop Accessibility Guidelines
- Enable users to cycle through Discord buttons and fields on desktop by pressing TAB repeatedly, ensuring that the activity does not capture control.
- Implement the functionality for the ESC key to close any open in-activity modals, providing a consistent user experience.
- Opt for color-blind friendly colors with high contrast, especially for crucial game elements that need to be distinguishable based on color. 
- Avoid using similar colors for objects that are essential for gameplay but differ only in color, as this may pose challenges for color-blind users.


================================================
FILE: developers/activities/development-guides/assets-and-metadata.mdx
================================================
---
title: Assets and Metadata
description: Guide to managing Activity assets, metadata, and configuration.
---

## Setting Up Activity Metadata

The Activity Shelf is where users can see what Activities can be played. It has various metadata and art assets that can be configured.

To update your app's metadata in the Discord Developer Portal, navigate to the `Settings -> General Information` tab of your app.

- **Application Name:** The publicly visible name of your app.
- **Application Icon:** The publicly visible icon for your app.
- **Application Description:** The application description is shown in the view of the Activity Shelf Item.
- **Max Participants:** The max participants indicate the maximum number of players for your application.
  - Max Participants is displayed above the name in the 1-up view: `Up to X participants`.
  - Leaving this field empty defaults to `Unlimited participants`.
  - Max Participants is also displayed under the name in the 2-up view.

<Info>
An app can have a different application name and avatar from the application's bot username and avatar. Both sets of metadata are public-facing and may be visible in various situations when a user interacts with your app. You can view your bot's username on the `Settings -> Bot` tab.
</Info>

---

## Setting Up Activity Art Assets

The Activity Shelf is where users can see what Activities can be played. It has various metadata and art assets that can be configured.

To update your app's embedded-specific art assets in the Discord Developer Portal, navigate to the [Activities -> Art Assets](https://discord.com/developers/applications/select/embedded/assets) tab of your app.

## Embedded Background

Used as a background overlay in Grid view. Artwork should be clustered around the edges of the image leaving space in the center of the image so the UI does not clash with it.

#### Specifications
- 16:9 aspect ratio
- At least 1024 pixels wide

## Cover Art

Used as the main image in the Activity Shelf. It is suggested that this image contain the title and some art in the background.

#### Specifications:
- Image can be displayed at both 16:9 and 13:11 aspect ratios
- At least 1024 pixels wide


## App Tile

There are two views of an application tile. The regular size tile (2-up tile) and the larger "featured" application tile (1-up tile).

## Video Preview

Hovering over the cover image should start playing a preview video of the Application. The preview videos should be no more than 10 seconds long. If no video is provided, nothing will happen as you hover over the application.

#### Specifications: 640 x 360, mp4 format, under 10 seconds long, under 1 MB in size


================================================
FILE: developers/activities/development-guides/growth-and-referrals.mdx
================================================
---
title: Growth and Referrals
description: Implement growth strategies and referral systems in Discord Activities.
---

## Prompting Users to Share Incentivized Links

Incentivized sharing can help grow your Activity through network effects. You can use links in several different ways such as:

- **Referral links.** Users can copy referral links inside your Activity, which include their Discord user ID (`https://discord.com/activities/<your Activity ID>?referrer_id=123456789`), and they can send to their friends. If their friend accepts and starts playing your game, then you gift the referrer something inside your game.
- **Promotions.** You can run a temporary promotion on social media, where you offer a reward if they start playing now. Share a custom link on your social media (`https://discord.com/activities/<your Activity ID>?custom_id=social012025` ). Anyone who clicks that specific link receives something inside your game.
- **Social deep-links.** Currently, when users launch an Activity, they all land in the same place. Instead, you can start deep-linking to contextually relevant points in your game. For example, user A can copy a link inside your Activity for engaging other users (`https://discord.com/activities/<your Activity ID>?referrer_id=123456789&custom_id=visit-location`), and sends the link to their friends in a DM or channel. Then, user B who clicks the link gets taken directly to user A’s location.
- **Turn-based deep-links.** When you send an “it’s your turn” DM to a user, you can include a link which takes them directly to the right game instance and the turn they need to take.
- **Affiliate marketing.** You can work with affiliates (influencers, companies, etc) to advertise your game to their followings, and reward them via a custom link (`https://discord.com/activities/<your Activity ID>?custom_id=influencer1`). Then, for every user that starts playing because of said influencer, you can then pay out to the influencer.
- **Source attribution.** You can use the `custom_id` parameter to figure out how much traffic you’re getting from different marketing sources.

This guide covers implementing a referral link which will feature a reward system for users who share links and those who click them.

#### Implementation Overview

1. Create and track an incentivized link for a promotional campaign, then prompt users to share the link
2. Handle incoming referrals and grant valid rewards

#### Sharing Links

When implementing sharing, you'll need to:
1. Generate a unique ID for tracking the promotion
2. Call the [`shareLink`](/developers/developer-tools/embedded-app-sdk#sharelink) command
3. Track the share attempt

```javascript
// Generate a unique ID for this promotion
// This could be per-campaign, per-user, or per-share depending on your needs
const customId = await createPromotionalCustomId();

try {
    const { success } = await discordSdk.commands.shareLink({
        message: 'Click this link to redeem 5 free coins!',
        custom_id: customId,
    });

    if (success) {
        // Track successful share for analytics/limiting
        await trackSuccessfulShare(customId);
    }
} catch (error) {
    // Handle share failures appropriately
    console.error('Failed to share link:', error);
}
```

#### Handling Incoming Referrals

When a user clicks a shared link, your activity will launch with referral data available through the SDK:

```javascript
// Early in your activity's initialization
async function handleReferral() {
    // Validate the referral data
    if (!discordSdk.customId || !discordSdk.referrerId) {
        return;
    }

    try {
        // Verify this is a valid promotion and hasn't expired
        const promotion = await validatePromotion(discordSdk.customId);
        if (!promotion) {
            console.log('Invalid or expired promotion');
            return;
        }

        // Prevent self-referrals
        if (discordSdk.referrerId === currentUserId) {
            console.log('Self-referrals not allowed');
            return;
        }

        // Grant rewards to both users
        await grantRewards({
            promotionId: discordSdk.customId,
            referrerId: discordSdk.referrerId,
            newUserId: currentUserId
        });
    } catch (error) {
        console.error('Failed to process referral:', error);
    }
}
```

#### Link Sharing Best Practices

- Generate unique, non-guessable `customId`s
- Track and validate referrals to prevent abuse
- Handle edge cases like expired promotions gracefully
- Consider implementing cool-down periods between shares
- Do not override the `referrer_id` query parameter directly. When present, `referrer_id` is expected to be a Discord snowflake-type user ID, otherwise it will be set to the message's author id.

---

## Creating and Managing Custom Incentivized Links

This guide covers creating a customizable [Incentivized Link](/developers/activities/development-guides/growth-and-referrals#prompting-users-to-share-incentivized-links) through the dev portal, and then retrieving the link to be able to share it off-platform. Incentivized Links are used to customize how the embed appears to users.

#### Creating a Link

1. In your Application's portal, visit the [Custom Links page](https://discord.com/developers/applications/select/embedded/custom-links) under the Activities heading in the navigation pane.
2. On the Custom Links page, click `Create New` to create a new link.
3. You will need to upload an image with an aspect ratio of 43:24.
4. Title, and description are also required.
5. `custom_id` is an optional field, an explicit `custom_id` query parameter on the link itself will always override the set `custom_id`.
6. Click Save.

#### Editing a Link

1. Click on a row to open up the modal with all of the data loaded in ready for your edits.
2. Change the description to something else.
3. Click Update.

#### Copying a Link

Once you're satisfied with your changes you can click on the copy icon on the row, it'll change colors to green indicating that it copied to your clipboard. You are now able to share this link anywhere. The link will look like: `https://discord.com/activities/<your Activity ID>?link_id=0-123456789`. Even if you've set a `custom_id`, it won't be explicitly included in the link but will be loaded once a user clicks on the link. You can then further shorten this URL if you'd like.

#### Deleting a Link

1. Click on the trash icon on the row of the link you're trying to delete.
2. You'll have a confirm dialog pop up.

<Warning>
Deleting is irreversible and immediate. Ensure that your link isn't in active use before deleting and/or that your activity gracefully handles any click-throughs from the link.
</Warning>

#### Best Practices

- Generate unique, non-guessable `customId`s
- Track and validate referrals to prevent abuse
- Gracefully handle expirations in your activity for any custom links that are limited time but still live off-platform.

#### User Experience

![custom-link-embed](/images/activities/custom-link-embed.png)

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.

---

## Generating a Custom Link Within Your Activity

This guide covers creating a customizable [Incentivized Link](/developers/activities/development-guides/growth-and-referrals#prompting-users-to-share-incentivized-links) within your activity, and using the `shareLink` API to share the link.

* Allows you to customize the way the link is presented to users via the embed
* Can be generated on-demand within your activity
* Ephemeral, 30 day TTL
* Does not show up in the developer portal

#### Generating a Link

```javascript
// Convert an image array buffer to base64 string
const image = base64EncodedImage;

// Generate the quick activity link
const linkIdResponse = await fetch(`${env.discordAPI}/applications/${env.applicationId}/quick-links/`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${accessToken}`,
    'Content-Type': 'application/json',
  },
  body: {
    custom_id: 'user_123/game_456',
    description: 'I just beat level 10 with a perfect score',
    title: 'Check out my high score!',
    image,
  }
});
const {link_id} = await linkIdResponse.json();

// Open the Share modal with the generated link
const {success} = await discordSdk.commands.shareLink({
  message: 'Check out my high score!',
  link_id,
});
success ? console.log('User shared link!') : console.log('User did not share link!');
```


================================================
FILE: developers/activities/development-guides/layout.mdx
================================================
---
title: Layout
description: Design effective layouts and user interfaces for Discord Activities.
---

## Application Orientation

#### Locking Application Orientation

This SDK provides APIs for locking the application to specific orientations. The possible lock states are `UNLOCKED`, `PORTRAIT`, and `LANDSCAPE`. `lock_state` is the default lock state, and it affects the app orientation when the application is focused. `picture_in_picture_lock_state` determines the PIP aspect ratio, and `grid_lock_state` determines the grid tile aspect ratio for the application. When `picture_in_picture_lock_state` is not set, the application PIP falls back to `lock_state` to determine the aspect ratio. When `grid_lock_state` is not set, the application grid tile falls back to `picture_in_picture_lock_state` to determine its aspect ratio, and if `picture_in_picture_lock_state`is not set, it uses `lock_state`.

Calling `setOrientationLockState` with an `undefined` or omitted value for `picture_in_picture_lock_state` or `grid_lock_state` will not change the corresponding lock states for the application. Calling `setOrientationLockState` with a null value for `picture_in_picture_lock_state` or `grid_lock_state` will clear the application's corresponding lock states such that those layout modes will use the fallback lock states.

```javascript
import {DiscordSDK, Common} from '@discord/embedded-app-sdk';
const discordSdk = new DiscordSDK(clientId);
await discordSdk.ready();

// Set a default lock state
discordSdk.commands.setOrientationLockState({lock_state: Common.OrientationLockStateTypeObject.LANDSCAPE});

// or set both a default lock state and a picture-in-picture lock state
discordSdk.commands.setOrientationLockState({
  lock_state: Common.OrientationLockStateTypeObject.PORTRAIT,
  picture_in_picture_lock_state: Common.OrientationLockStateTypeObject.LANDSCAPE,
  grid_lock_state: Common.OrientationLockStateTypeObject.LANDSCAPE,
});
```

#### Configuring Default Orientation Lock State Through the Developer Portal

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.

![default-orientation-lock-state](/images/activities/default_orientation_lock_state.png)

#### Subscribing to Screen Orientation Updates

To listen to the screen orientation (which is sometimes different from the physical device orientation), subscribe to the `ORIENTATION_UPDATE` event. Discord will publish the current orientation upon event subscription, and it'll also publish any orientation changes that happen afterward.

```javascript
const handleOrientationUpdate = (update: {screen_orientation: number}) => {
  switch (update.screen_orientation) {
      case Common.OrientationTypeObject.PORTRAIT:
        ...
      case Common.OrientationTypeObject.LANDSCAPE:
        ...
      default:
        ...
    }
}

discordSdk.subscribe('ORIENTATION_UPDATE', handleOrientationUpdate);
```

---

## Application Layout Mode

There are three layout modes that an application can be in: focused, picture-in-picture (PIP), or grid mode. Activities can subscribe to the layout mode to determine when to optionally change their layouts to optimize for each layout mode. Old Discord clients only support the `ACTIVITY_PIP_MODE_UPDATE` event, while new Discord clients support both `ACTIVITY_PIP_MODE_UPDATE` and `ACTIVITY_LAYOUT_MODE_UPDATE`. Use `subscribeToLayoutModeUpdatesCompat` and `unsubscribeFromLayoutModeUpdatesCompat` to subscribe to both events with backward compatibility for old Discord clients that only support `ACTIVITY_PIP_MODE_UPDATE`. Here's an example using React:

```javascript
export default function LayoutMode() {
  const handleLayoutModeUpdate = React.useCallback((update: {layout_mode: number}) => {
       ...
  }, []);

  React.useEffect(() => {
    discordSdk.subscribeToLayoutModeUpdatesCompat(handleLayoutModeUpdate);
    return () => {
      discordSdk.unsubscribeFromLayoutModeUpdatesCompat(handleLayoutModeUpdate);
    };
  }, [handleLayoutModeUpdate]);
}
```


================================================
FILE: developers/activities/development-guides/local-development.mdx
================================================
---
title: Local Development
sidebarTitle: Local Development
description: Set up local development environment for Discord Activities.
---

## Run Your Application Locally

It is possible to load your application via a localhost port or other unique URL. This URL must support an HTTPS connection to load on the web/desktop Discord app (HTTPS is not required for mobile). The downside to this flow is that your application's network traffic will not pass through Discord's proxy, which means any requests made by the application will need to use a full URL instead of a ["mapped"](/developers/activities/development-guides/local-development#url-mapping) URL.

To run your locally hosted application, follow the instructions for [Launching your Application from the Discord Client](/developers/activities/development-guides/local-development#launch-your-application-from-the-discord-client) and set the Application URL Override to the address of your application's web server.

### Running Your Application Through A Network Tunnel

Although it is possible to test your application locally, we recommend developing and testing against the Discord proxy. This is helpful to make sure all URLs behave as expected before your application runs in production. One technique to enable testing locally against the proxy is to use a network tunneling tool, such as [cloudflared](https://github.com/cloudflare/cloudflared#installing-cloudflared). A typical pattern is for each developer to have their own "development-only" application. To set up a local environment to run through Discord's proxy, you will need to do the following:

1. Create a new application in the Discord Developer portal.
2. Enable Activities for your app.
3. Set up the application's [URL mapping](/developers/activities/development-guides/local-development#url-mapping).
4. Locally, spin up your web server.
5. Install and run a tunnel solution, such as [cloudflared](https://github.com/cloudflare/cloudflared#installing-cloudflared). You will point it to your local web server.

<Info>
Your web server can be HTTP and your network tunnel can upgrade the connection to HTTPS.
</Info>

If using cloudflared, you will run the following command, replace `3000` with your web server's port.

```
cloudflared tunnel --url http://localhost:3000
```

Once you run this command, you will receive your publicly accessible network tunnel address from cloudflared.

```
Your quick Tunnel has been created! Visit it at (it may take some time to be reachable):
https://funky-jogging-bunny.trycloudflare.com
```

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.

![Configuring your URL Mapping](/images/activities/url-mapping-tutorial.png)

<Warning>
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.
</Warning>

Follow the instructions for [Launching your Application from the Discord Client](/developers/activities/development-guides/local-development#launch-your-application-from-the-discord-client). Application URL Override should not be enabled.

### Running Your Application In Production

The flow for setting up your production application is very similar:

1. If not made yet, create a new application.
2. Enable Activities for your app.
3. Set up the application's [URL Mapping](/developers/activities/development-guides/local-development#url-mapping). The URL for your application's html should be set to the `/` route.
4. Follow the instructions for [Launching your Application from the Discord Client](/developers/activities/development-guides/local-development#launch-your-application-from-the-discord-client). Application URL Override should not be enabled.

This application now uses the same configuration it will use once it is fully published ✨.

![application-test-mode-prod](/images/activities/application-test-mode-prod.gif)

---

### Launch your application from the Discord Client

You will be able to see and launch all activities owned by you or any teams you are a member of via the Developer Activity Shelf. One caveat is that the activity will not be shown on the current platform (web/ios/android) unless you have checked your platform in [Settings/Supported Platforms](https://discord.com/developers/applications/select/embedded/settings) on the developer portal.

To see you app inside of Discord in the Activity Shelf:

#### Web

1. Select ⚙️ User Settings > App Settings > Advanced and toggle on `Developer Mode`
3. Close the settings window and enter a voice channel.
4. From either the RTC Panel or the Center Control Tray, click on the "Rocket Button" to open the Activity shelf. You should now see all of the same applications that you have access to in the developer portal. Note: The shelf will only include applications which have been flagged as "Embedded".
6. Click on an activity to launch it!

#### Mobile

1. From your User Profile, select Appearance, and then toggle "On" `Developer Mode`
2. Enter a voice channel
5. Click on an activity to launch it!

---

### URL Mapping

Activities in Discord are "sandboxed" via a Discord proxy. This is done to hide the users' IP addresses, your application's IP addresses, and to block URLs from known malicious endpoints. As an application owner, you can configure the proxy to allow network requests to external endpoints.

Because your application is "sandboxed", it will be unable to make network requests to external URLs. Let's say you want request `https://some-api.com`. To enable reaching this url from inside your application, you will create a new url mapping, with the `PREFIX` set to
`/api` and `TARGET` set to `some-api.com`. Now you can make requests to `/api` from inside of your application, which will be forwarded, via Discord's proxy to `some-api.com`.

#### How to set a URL Mapping

To add or modify your application's URL mappings, click on [Activities -> URL Mappings](https://discord.com/developers/applications/select/embedded/url-mappings) and set the prefix and target values for each mapping as needed.

![Configuring your URL Mapping](/images/activities/url-mapping-tutorial.png)

#### Prefix/Target formatting rules

- URL mappings can utilize any url protocol, (https, wss, ftp, etc...), which is why the URL target should not include a protocol. For example, for a URL target, do not put `https://your-url.com`, instead, omit `https://` and use `your-url.com`.
- Parameter matching can be used to help map external domain urls. For example, if an external url has many subdomains, such as `foo.google.com`, `bar.google.com`, then you could use the following mapping:
  | PREFIX                | TARGET                   |
  |-----------------------|--------------------------|
  | `/google/{subdomain}` | `{subdomain}.google.com` |
- 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.
- 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.

| ✅ DO                                                        | ❌ DON'T                                                         |
|--------------------------------------------------------------|------------------------------------------------------------------|
| Requests mapped correctly                                    | Requests to /foo/bar will incorrectly be sent to `foo.com`       |
| ![url-mapping-do.png](/images/activities/url-mapping-do.png) | ![url-mapping-dont.png](/images/activities/url-mapping-dont.png) |

#### Exceptions

The aforementioned "sandbox" is enforced by a [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP). We have some notable exceptions to our CSP, meaning application clients may make requests to these URLs without hitting the proxy and therefore without establishing mappings. Notable exceptions include:

- `https://discord.com/api/`
- `https://canary.discord.com/api/`
- `https://ptb.discord.com/api/`
- `https://cdn.discordapp.com/attachments/`
- `https://cdn.discordapp.com/avatars/`
- `https://cdn.discordapp.com/icons/`
- `https://media.discordapp.net/attachments/`
- `https://media.discordapp.net/avatars/`
- `https://media.discordapp.net/icons/`

---

### Logging

By default, the SDK will send any console `log`, `warn`, `error`, `info`, and `debug` events triggered by your app to the Discord application.

#### Viewing Logs on Desktop

Desktop logs are viewable through the console tab inside a browser's Developer Tools. See the [Troubleshooting Console Log Errors](https://support.discord.com/hc/en-us/articles/115001239472-Troubleshooting-Console-Log-Errors) support article for more information.

The Public Test Build (PTB) Discord client also allows inspecting your logs from the `View -> Developer -> Toggle Developer Tools` menu.  It can be downloaded at [https://discord.com/downloads](https://discord.com/downloads).

#### Viewing Logs on Mobile

Mobile logs are viewable via the `Debug Logs` option inside User Settings on the mobile App. It is only discoverable when you have `Developer Mode` enabled.

1. On the bottom navigation, tap on your avatar and then the gear icon to open your `User Settings`.
2. Tap `Appearance`.
3. Slide the `Developer Mode` toggle to ON.
4. The `Debug Logs` option will be available under the `DEV ONLY` section.

#### Filtering for Application Logs

Inside the Debug Logs view, you can search for your own application logs with the possible keywords:

- `RpcApplicationLogger`
- Your Application ID

Each log line is formatted as: `[RpcApplicationLogger] <application-id> - message`

The first section of Debug Logs are not your application logs but Discord specific app startup info which is not relevant to your application.

When you scroll down the page, your application logs should be visible.

![debug-logs-filtering](/images/activities/debug-logs-filtering.gif)

#### Sharing Application Logs from Mobile

With `Developer Mode` enabled, you can share your application logs from within a Voice Channel.

1. In the voice channel, swipe from the bottom to see the expanded voice controls. Tap on `Share Application Logs`.
2. You'll be presented with a native share sheet where you can save the logs to a file or share it as a message.

#### Disabling Logging

If you do not want logs to be forwarded to the browser, you can disable it with the optional configuration object.

```javascript
import {DiscordSDK} from '@discord/embedded-app-sdk';
const discordSdk = new DiscordSDK(clientId, {
  disableConsoleLogOverride: true,
});
```

#### Forwarding Log Messages

You can forward specific log messages via the SDK command `captureLog` as shown below.

```javascript
import {DiscordSDK} from '@discord/embedded-app-sdk';
const discordSdk = new DiscordSDK(clientId);
await discordSdk.ready();
discordSdk.commands.captureLog({
  level: 'log',
  message: 'This is my log message!',
});
```


================================================
FILE: developers/activities/development-guides/mobile.mdx
================================================
---
title: Mobile
description: Design and optimize Discord Activities for mobile devices.
---

## Supported Platforms: Web, iOS, Android

By default, your Activity will be launchable on web/desktop. To enable or disable support for Web/iOS/Android, do the following:

- Visit the [developer portal](https://discord.com/developers/applications)
- Select your application
- Select [Activities -> Settings](https://discord.com/developers/applications/select/embedded/settings) in the left-side of the developer portal
- From check the appropriate checkboxes in the developer portal, and save your changes

![supported-platforms](/images/activities/supported-platforms.png)

---

## Mobile Safe Areas

As an example, you can define your safe area insets as below in CSS:

```css
:root {
  --sait: var(--discord-safe-area-inset-top, env(safe-area-inset-top));
  --saib: var(--discord-safe-area-inset-bottom, env(safe-area-inset-bottom));
  --sail: var(--discord-safe-area-inset-left, env(safe-area-inset-left));
  --sair: var(--discord-safe-area-inset-right, env(safe-area-inset-right));
}
```

This prefers the `--discord-safe-area-inset-*` variable and will fallback to the env values for iOS + any local dev testing that is done outside of Discord.

You can then reference these values:

```css
body {
  padding-left: var(--sail);
  padding-right: var(--sair);
  padding-top: var(--sait);
  padding-bottom: var(--saib);
}
```

---

## Mobile Thermal States

You may need to respond to thermal state changes using recommendations from [thermal states surfaced by mobile devices](https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/RespondToThermalStateChanges.html) to improve the user experience.

Discord's Embedded App SDK provides an abstraction over [Apple's thermal state APIs](https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/RespondToThermalStateChanges.html) and [Android's thermal state APIs](https://source.android.com/docs/core/power/thermal-mitigation#thermal-api).

Here's how Discord's abstraction maps to Apple's thermal states and Android's thermal states.

```javascript
enum ThermalState {
  NOMINAL = 0, // maps to "nominal" on iOS and "none" on Android
  FAIR = 1, // maps to "fair" on iOS and "light" / "moderate" on Android
  SERIOUS = 2, // maps to "serious" on iOS and "severe" on Android
  CRITICAL = 3, // maps to "critical" on iOS and "critical" / "emergency" / "shutdown" on Android
}
```

The Embedded App SDK allows developers to subscribe to these thermal state changes.

```javascript
const handleThermalStateUpdate = (update: {thermal_state: number}) => {
  switch (thermalState) {
      case Common.ThermalStateTypeObject.NOMINAL:
        ...
      case Common.ThermalStateTypeObject.FAIR:
        ...
      case Common.ThermalStateTypeObject.SERIOUS:
        ...
      case Common.ThermalStateTypeObject.CRITICAL:
        ...
      default:
        ...
    }
}

discordSdk.subscribe('THERMAL_STATE_UPDATE', handleThermalStateUpdate);
```

Discord will publish the current thermal state upon event subscription, and it will also publish any thermal state changes that happen afterward.

<Info>
On Android devices, the thermal state updates will only be available on Android 10 and higher.
</Info>


================================================
FILE: developers/activities/development-guides/multiplayer-experience.mdx
================================================
---
title: Multiplayer Experience
description: Design and implement engaging multiplayer experiences in Discord Activities.
---

## Activity Instance Management

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**.

![join-application](/images/activities/join-application.png)

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.

#### Using instanceId

The `instanceId` attribute is available as soon as the SDK is constructed, and does not require the SDK to receive a `ready` payload from the Discord client.

```javascript
import {DiscordSDK} from '@discord/embedded-app-sdk';
const discordSdk = new DiscordSDK(clientId);
// available immediately
const instanceId = discordSdk.instanceId;
```

The `instanceId` should be used as a key to save and load the shared data relevant to an application. This ensures that two users who are in the same application instance have access to the same shared data.

##### Semantics of instanceId

Instance IDs are generated when a user launches an application. Any users joining the same application will receive the same `instanceId`. When all the users of an application in a channel leave or close the application, that instance has finished its lifecycle, and will not be used again. The next time a user opens the application in that channel, a new `instanceId` will be generated.

---

## Instance Participants

Instance Participants are any Discord user actively connected to the same Application Instance. This data can be fetched or subscribed to.

```javascript
import {DiscordSDK, Events, type Types} from '@discord/embedded-app-sdk';

const discordSdk = new DiscordSDK('...');
await discordSdk.ready();

// Fetch
const participants = await discordSdk.commands.getActivityInstanceConnectedParticipants();

// Subscribe
function updateParticipants(participants: Types.GetActivityInstanceConnectedParticipantsResponse) {
  // Do something really cool
}
discordSdk.subscribe(Events.ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE, updateParticipants);
// Unsubscribe
discordSdk.unsubscribe(Events.ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE, updateParticipants);
```

---

## Render Avatars and Names

Check out detailed documentation on where and how Discord stores common image assets [here](/developers/reference#image-formatting-cdn-endpoints).

Here's a basic example for retrieving a user's avatar and username

```javascript
// We'll be referencing the user object returned from authenticate
const {user} = await discordSdk.commands.authenticate({
  access_token: accessToken,
});

let avatarSrc = '';
if (user.avatar) {
  avatarSrc = `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=256`;
} else {
  const defaultAvatarIndex = (BigInt(user.id) >> 22n) % 6n;
  avatarSrc = `https://cdn.discordapp.com/embed/avatars/${defaultAvatarIndex}.png`
}

const username = user.global_name ?? `${user.username}#${user.discriminator}`;

// Then in your HTML/JSX/etc...
<img alt="avatar" src={avatarSrc} />
<p>{username}</p>
```

#### Rendering guild-specific avatars and nicknames

In order to retrieve a user's guild-specific avatar and nickname, your application must request the `guilds.members.read` scope. Note, this only grants the information for that instance of the application's user. To display the guild-specific avatar/nickname for all application users, any info retrieved from `guilds.members.read` scope'd API calls must be shared via your application's server.

Here's an example of how to retrieve the user's guild-specific avatar and nickname:

```javascript
// We'll be referencing the user object returned from authenticate
const {user} = await discordSdk.commands.authenticate({
  access_token: accessToken,
});

// When using the proxy, you may instead replace `https://discord.com` with `/discord`
// or whatever url mapping you have chosen via the developer portal
fetch(`https://discord.com/api/users/@me/guilds/${discordSdk.guildId}/member`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${accessToken}`,
  },
})
  .then((response) => {
    return response.json();
  })
  .then((guildsMembersRead) => {
    let guildAvatarSrc = '';
    // Retrieve the guild-specific avatar, and fallback to the user's avatar
    if (guildsMembersRead?.avatar) {
      guildAvatarSrc = `https://cdn.discordapp.com/guilds/${discordSdk.guildId}/users/${user.id}/avatars/${guildsMembersRead.avatar}.png?size=256`;
    } else if (user.avatar) {
      guildAvatarSrc = `https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png?size=256`;
    } else {
      const defaultAvatarIndex = (BigInt(user.id) >> 22n) % 6n;
      avatarSrc = `https://cdn.discordapp.com/embed/avatars/${defaultAvatarIndex}.png`;
    }

    // Retrieve the guild-specific nickname, and fallback to the username#discriminator
    const guildNickname = guildsMembersRead?.nick ?? (user.global_name ?? `${user.username}#${user.discriminator}`);
  });
```

This example is being done entirely on the client, however, a more common pattern is to instead, do the following:

- Store the user's access token on the application server
- Retrieve the user's guild-specific avatar and nickname via the application's server
- Serve all of the application's avatar/nicknames via the application's server

---

## Preventing unwanted activity sessions

Activities are surfaced through iframes in the Discord app. The activity website itself is publicly reachable at `<application_id>.discordsays.com`. Activities will expect to be able to communicate with Discord's web or mobile client via the Discord SDK's RPC protocol. If a user loads the activity's website in a normal browser, the Discord RPC server will not be present, and the activity will likely fail in some way.

It is theoretically possible for a malicious client to mock Discord's RPC protocol or load one activity website when launching another. Because the activity is loaded inside Discord, the RPC protocol is active, and the activity is none the wiser.

### Using the Activity Instance API

To enable an activity to "lock down" activity access, we encourage utilizing the `get_activity_instance` API, found at `discord.com/api/applications/<application_id>/activity-instances/<instance_id>'`. The route requires a Bot token of the application. It returns a serialized active activity instance for the given application, if found, otherwise it returns a 404. Here are two example responses:

```javascript
curl https://discord.com/api/applications/1215413995645968394/activity-instances/i-1234567890-gc-912952092627435520-912954213460484116 -H 'Authorization: Bot <bot token>'
{"message": "404: Not Found", "code": 0}

curl https://discord.com/api/applications/1215413995645968394/activity-instances/i-1276580072400224306-gc-912952092627435520-912954213460484116 -H 'Authorization: Bot <bot token>'
{"application_id":"1215413995645968394","instance_id":"i-1276580072400224306-gc-912952092627435520-912954213460484116","launch_id":"1276580072400224306","location":{"id":"gc-912952092627435520-912954213460484116","kind":"gc","channel_id":"912954213460484116","guild_id":"912952092627435520"},"users":["205519959982473217"]}
```

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.

### Validating Proxy Request Headers

For apps that want additional security validation, Discord provides an optional proxy authentication system. When your embedded app makes requests through Discord's proxy, each request can include cryptographic headers that prove the request's authenticity.

Each proxy-authenticated request is sent with the following headers:

- `X-Signature-Ed25519` as a cryptographic signature
- `X-Signature-Timestamp` as a Unix timestamp 
- `X-Discord-Proxy-Payload` as a base64-encoded payload containing user context

If you choose to use proxy authentication, you can validate these headers to ensure requests are legitimate. If the signature fails validation, your app should respond with a `401` error code.

<Accordion title="Validating Proxy Headers" description="Code example for validating proxy authentication headers" icon="code">
Below are some code examples that show how to validate the headers sent in proxy-authenticated requests.

**JavaScript**

```js
const nacl = require("tweetnacl");

// Your public key can be found on your application in the Developer Portal
const PUBLIC_KEY = "APPLICATION_PUBLIC_KEY";

const signature = req.get("X-Signature-Ed25519");
const timestamp = req.get("X-Signature-Timestamp");
const payload = req.get("X-Discord-Proxy-Payload");

// Decode the base64 payload
const payloadBytes = Buffer.from(payload, "base64");
const payloadString = payloadBytes.toString("utf-8");
const payloadData = JSON.parse(payloadString);

// Verify timestamp matches payload
if (payloadData.created_at.toString() !== timestamp) {
    return res.status(401).end("invalid request timestamp");
}

// Check if token has expired
if (payloadData.expires_at < Math.floor(Date.now() / 1000)) {
    return res.status(401).end("expired proxy token");
}

// Verify the signature using tweetnacl
const isVerified = nacl.sign.detached.verify(
    payloadBytes,
    Buffer.from(signature, "base64"),
    Buffer.from(PUBLIC_KEY, "hex")
);

if (!isVerified) {
    return res.status(401).end("invalid request signature");
}
```

**Python**

```py
import json
import base64
import time
from nacl.signing import VerifyKey
from nacl.exceptions import BadSignatureError

# Your public key can be found on your application in the Developer Portal
PUBLIC_KEY = 'APPLICATION_PUBLIC_KEY'

verify_key = VerifyKey(bytes.fromhex(PUBLIC_KEY))

signature = request.headers["X-Signature-Ed25519"]
timestamp = request.headers["X-Signature-Timestamp"]
payload = request.headers["X-Discord-Proxy-Payload"]

# Decode the base64 payload
payload_bytes = base64.b64decode(payload)
payload_string = payload_bytes.decode('utf-8')
payload_data = json.loads(payload_string)

# Verify timestamp matches payload
if str(payload_data['created_at']) != timestamp:
    abort(401, 'invalid request timestamp')

# Check if token has expired
if payload_data['expires_at'] < int(time.time()):
    abort(401, 'expired proxy token')

try:
    verify_key.verify(payload_bytes, bytes.fromhex(signature))
except BadSignatureError:
    abort(401, 'invalid request signature')
```
</Accordion>

Proxy authentication is entirely optional and provided as an additional security layer for apps that choose to implement it.

In the below flow diagram, we show how the server can deliver the activity website, only for valid users in a valid activity instance:

![activity-instance-validation](/images/activities/activity-instance-validation.jpg)


================================================
FILE: developers/activities/development-guides/networking.mdx
================================================
---
title: Networking
description: Learn networking patterns and best practices for Discord Activities.
---

## Activity Proxy Considerations

All network traffic is routed through the Discord Proxy for various security reasons.

Under the hood we utilize Cloudflare Workers, which brings some restrictions, outlined below.

#### WebTransport

While we currently only support websockets, we're working with our upstream providers to enable WebTransport.

#### WebRTC

WebRTC is not supported.

---

## Construct A Full URL

There are scenarios where instead of using a relative url (`/path/to/my/thing`) you may want or need to reference the full url when making a network request. The URL is a combination of the following

1. The protocol you wish to use
2. Your application's client id
3. The discord proxy domain
4. Whatever you need to list

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

```javascript
const protocol = `https`;
const clientId = '<YOUR CLIENT ID>';
const proxyDomain = 'discordsays.com';
const resourcePath = '/foo/bar.jpg';
const url = new URL(`${protocol}://${clientId}.${proxyDomain}${resourcePath}`);
```

In other words, given an application client id of `12345678`
| Relative Path | Full Path                                    |
|---------------|----------------------------------------------|
| /foo/bar.jpg  | https://12345678.discordsays.com/foo/bar.jpg |

---

## Using External Resources

Activities in Discord are "sandboxed" via a Discord proxy. This is done to hide the users' IP addresses as well as block URLs from known malicious endpoints. To achieve this, the Discord Developer Portal has a section for [configuring URL Mappings](/developers/activities/development-guides/local-development#url-mapping) for your application.

One edge-case of URL mappings is that third-party NPM modules or other resources may reference external (non-sandboxed) urls.

For example, if your application has an npm module that attempts to make an http request to https://foo.library.com, the request will fail with a `blocked:csp` error.

To get around this limitation there are several options to consider:

- Fork the library (to use mapped urls)
- Utilize a post-install utility such as [patch-package](https://www.npmjs.com/package/patch-package)
- Use our Embedded App SDK's `patchUrlMappings` API

In the above scenario, we recommend using the `patchUrlMappings` API, as it will allow a smooth transition from the non-sandboxed dev environment to the production environment.

This method call takes an array of "mappings" which will transform any external network requests to the mappings you've defined.

See the example below:

- In this example, imagine you have a third-party library which makes an HTTP request to foo.com
- In the developer portal, create a mapping like this: `/foo` -> `foo.com`
- Then in your code, when initializing the SDK, you will make a function call.


```javascript
import {patchUrlMappings} from '@discord/embedded-app-sdk';
const isProd = process.env.NODE_ENV === 'production'; // Actual dev/prod env check may vary for you

async function setupApp() {
  if (isProd) {
    patchUrlMappings([{prefix: '/foo', target: 'foo.com'}]);
  }
  // start app initialization after this....
}
```

<Info>
Note: `patchUrlMappings` is modifying your browser's `fetch`, `WebSocket`, and `XMLHttpRequest.prototype.open` global variables. Depending on the library, you may see side effects from using this helper function. It should be used only when necessary.
</Info>

---

## Security Considerations

#### Trusting Client Data

Do not trust data coming from the Discord client as truth. It's fine to use this data in your application locally, but assume any data coming from the Discord Client could be falsified. That includes data about the current user, their nitro status, their current channel, etc. If you need this information in a trusted manner, contact Discord API directly from your application's server, with the user token you received from completing the OAuth2 flow.

Furthermore, data coming from the Discord client is not sanitized beforehand.  Things like usernames and channel names are arbitrary user input.  Make sure to sanitize these strings or use `.textContent` (for example) to display them safely in your UI.

#### Using Cookies

To set a cookie for your activity to use in network requests through the proxy, make sure the cookie's domain matches your app's full `{clientId}.discordsays.com` domain. You will also need to explicitly set `SameSite=None Partitioned` on the cookie. `SameSite=None` is needed as browsers refuse to store or send cookies with higher restriction levels for any navigation within an iframe. `Partitioned` then limits the use of that cookie to only Discord's iframes.

Rest assured: other activities will not be able to make requests with your activity's cookie, thanks to the Content Security Policy (CSP) limiting requests only to your own app's proxy.


================================================
FILE: developers/activities/development-guides/production-readiness.mdx
================================================
---
title: Production Readiness
description: Prepare your Discord Activity for production deployment.
---

## Cache Busting

All assets loaded by your application will respect [cache headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control). One exception is that Discord's application proxy will remove any cache headers for assets whose `content-type` headers include `text/html`. For all non-`text/html` content that your application plans to serve, be sure your application has a cache-busting strategy. This is often built into build processes. If your application has a static filename for its javascript or css, please be sure to implement cache busting techniques, for example [webpack enables creating dynamic file names](https://webpack.js.org/guides/caching/).

----

## Handling Rate Limits

Be sure network requests made by your application's client and server will be able to respect Discord API's rate limiting [as described here](/developers/topics/rate-limits).

See [this implementation in the Activity Starter project](https://github.com/discord/embedded-app-sdk-examples/blob/main/discord-activity-starter/packages/server/src/utils.ts) for an example of how to respect the `retry_after` header when you receive a 429 error.

---

## Static IP Addresses

If your application's server is utilizing a dynamically assigned IP address (this is standard for cloud functions), there is a non-zero chance that you will inherit from a previous bad actor an IP address which has been banned by Cloudflare. In this scenario any egress traffic from the IP address directed towards Discord's API will be banned for up-to an hour. The best way to mitigate this situation is to set up a static IP address for all of your application server's egress traffic to be routed through.

---

## Backward Compatibility

#### New Commands

When new commands become available in the embedded-app-sdk, those commands won't be supported by all Discord app versions. The new command will typically only be supported by newer Discord app versions. When an application tries to use a new command with an old Discord app version that doesn't support the command, the Discord app will respond with error code `INVALID_COMMAND` which the application can handle like this:

```javascript
try {
  const {permissions} = await discordSdk.commands.getChannelPermissions();

  // check permissions
  ...
} catch (error) {
  if (error.code == RPCErrorCodes.INVALID_COMMAND) {
    // This is an expected error. The Discord client doesn't support this command
    ...
  } else {
    // Unexpected error
    ...
  }
}
```


================================================
FILE: developers/activities/development-guides/user-actions.mdx
================================================
---
title: User Actions
description: Implement user interactions and actions in Discord Activities.
---

## Open External Link

Since Activities are sandboxed, your app will need to perform a command in order for users to launch any external links. Users will be prompted inside Discord whether or not they want to open the external link.

#### Usage

```javascript
import {DiscordSDK} from '@discord/embedded-app-sdk';
const discordSdk = new DiscordSDK(clientId);
await discordSdk.ready();
// Once the sdk has established the connection with the discord client, external
// links can be launched
discordSdk.commands.openExternalLink({
  url: 'https://google.com',
});
```

#### User Experience

![external-link-modal](/images/activities/external-link-modal.png)

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.

---

## Open Invite Dialog

Getting an Application Channel Invite, as outlined in [these docs](/developers/resources/invite#get-invite), is not granted by any OAuth scopes. Nonetheless, the `openInviteDialog` command is available via the SDK. This command opens the Application Channel Invite UI within the discord client without requiring additional OAuth scopes.

This command returns an error when called from DM (Direct Message) contexts, so should only be called in Guild Voice or Text Channels. Similarly, this command returns an error if the user has invalid permissions for the channel, so using `getChannelPermissions` (requires OAuth scope `'guilds.members.read'`) is highly recommended.

#### Usage

```javascript
import {DiscordSDK, Permissions, PermissionUtils} from '@discord/embedded-app-sdk';
const discordSdk = new DiscordSDK(clientId);
await discordSdk.ready();

try {
  const {permissions} = await discordSdk.commands.getChannelPermissions();
  if (PermissionUtils.can(Permissions.CREATE_INSTANT_INVITE, permissions)) {
    await discordSdk.commands.openInviteDialog();
    // successfully opened dialog
  } else {
    console.warn('User does not have CREATE_INSTANT_INVITE permissions');
  }
} catch (err) {
  // failed to fetch permissions or open dialog
  console.warn(err.message);
}
```

User Experience

![Invite Dialog UI](/images/activities/invite-dialog.png)

Users will see a modal inside the Discord app allowing them to send an invite to a channel, friend, or copy an invite link to share manually.

---

## Open Share Moment Dialog

The easiest way for an application to share media to a channel or DM is to use the `openShareMomentDialog` command. This command accepts a Discord CDN `mediaUrl` (eg `https://cdn.discordapp.com/attachments/...`) and opens a dialog on the discord client that allows the user to select channels, DMs, and GDMs to share to. This requires no additional OAuth scopes, but does require the application to be authenticated.

Since `mediaUrl` must be a Discord CDN URL, it is encouraged to use the activities attachment API endpoint (`discord.com/api/applications/${applicationId}/attachment`) to create an ephemeral CDN URL. This endpoint accepts bearer tokens for any scopes, so it can be called from the application client using the authorized user's bearer token. The endpoint returns a serialized attachment, which includes a `url` attribute, which should then be passed to the DiscordSDK command as `mediaUrl`.

#### Usage

```javascript
import {discordSdk} from './wherever-you-initialize-your-sdk';
import {accessToken} from './wherever-you-store-your-access-token';

// some image
const imageURL = 'https://i.imgur.com/vaSWuKr.gif';

// get image data
const response = await fetch(imageURL);
const blob = await response.blob();
const mimeType = blob.type;

// image data as buffer
const buf = await blob.arrayBuffer();

// image as file
const imageFile = new File([buf], 'example.gif', {type: mimeType});

const body = new FormData();
body.append('file', imageFile);

const attachmentResponse = await fetch(`${env.discordAPI}/applications/${env.applicationId}/attachment`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${accessToken}`,
  },
  body,
});
const attachmentJson = await attachmentResponse.json();

// mediaUrl is an ephemeral Discord CDN URL
const mediaUrl = attachmentJson.attachment.url;

// opens dialog in Discord client
await discordSdk.commands.openShareMomentDialog({mediaUrl});
```

User Experience

![Example of the sharing dialog](/images/activities/share-moment-dialog-example.png)

---

## Setting Up an Entry Point Command

An [Entry Point command](/developers/interactions/application-commands#entry-point-commands) is required for users to be able to launch your Activity from the [App Launcher menu](https://support.discord.com/hc/articles/21334461140375-Using-Apps-on-Discord#h_01HRQSA6C8TRHS722P1H3HW1TV) in Discord.

When you enable Activities in your [app's settings](http://discord.com/developers/applications), a [default Entry Point command](/developers/interactions/application-commands#default-entry-point-command) is automatically created for your app. The default Entry Point command will use the `DISCORD_LAUNCH_ACTIVITY` (`2`) [handler type](/developers/interactions/application-commands#application-command-object-entry-point-command-handler-types), which means that Discord automatically launches your Activity for the user and posts a follow-up message into the channel where it was launched from.

If you want to handle sending messages yourself, you can update the handler to be `APP_HANDLER` (`1`). Details about Entry Point command handlers is in the [Entry Point command documentation](/developers/interactions/application-commands#entry-point-handlers).

#### Customizing the Default Entry Point Command

Entry Point commands can be customized in the same way as other [commands](/developers/interactions/application-commands). Since Entry Point commands can only be [global](/developers/interactions/application-commands#making-a-global-command), you'll use the HTTP endpoints for global  commands:
- **Edit your existing Entry Point command's name or details** using the [Edit Global Application Command](/developers/interactions/application-commands#edit-global-application-command) endpoint. If you don't know the ID for your app's Entry Point command, use the [Get Global Application Commands](/developers/interactions/application-commands#get-global-application-commands) endpoint to retrieve it.
- **Make a different (option-less) command your Entry Point command** by updating its [command `type`](/developers/interactions/application-commands#application-command-object-application-command-types) to `PRIMARY_ENTRY_POINT` (type `4`). Your app can only have one Entry Point command, so if your app already has one, you must first [delete](/developers/interactions/application-commands#delete-global-application-command) it or [update](/developers/interactions/application-commands#edit-global-application-command) its [command `type`](/developers/interactions/application-commands#application-command-object-application-command-types).

#### Creating an Entry Point Command

To create a new Entry Point command, you can call the [Create Global Application Command](/developers/interactions/application-commands#create-global-application-command) endpoint and set the [command `type`](/developers/interactions/application-commands#application-command-object-application-command-types) to `PRIMARY_ENTRY_POINT` (type `4`).

Your command payload may look something like this:

```json
{
  "name": "launch",
  "description": "Launch Realms of Wumpus",
  // PRIMARY_ENTRY_POINT is type 4
  "type": 4,
  // DISCORD_LAUNCH_ACTIVITY is handler value 2
  "handler": 2,
  // integration_types and contexts define where your command can be used (see below)
  "integration_types": [0, 1],
  "contexts": [0, 1, 2]
}
```

In addition to the `type` and `handler` values, the command payload includes `integration_types` and `contexts` which let you configure when and where your command can be used:
- `integration_types` defines the [installation contexts](/developers/resources/application#installation-context) where your command is available (to a server, to a user's account, or both). If you don't set `integration_types` when creating a command, it will default to your app's [currently-supported installation contexts](/developers/resources/application#setting-supported-installation-contexts).
- `contexts` defines the [interaction contexts](/developers/interactions/receiving-and-responding#interaction-object-interaction-context-types) where a command can be run in Discord (in a server, in a DM with your app, and/or in DMs and Group DMs with other users).

Details about both of these fields are in the [command contexts](/developers/interactions/application-commands#contexts) documentation.

---

## Encourage Hardware Acceleration

Activities that are compute intensive may benefit from encouraging users to enable hardware acceleration. When an application invokes the `encourageHardwareAcceleration` command the current status of the setting will be returned and the user will be prompted to update the setting, if applicable.

Users will see a modal inside the Discord app if Hardware Acceleration is disabled, encouraging them to change the setting. By clicking **Don't show me this again** they will not see the modal for _any application_ on this device again.

#### Best Practices

Switching the Hardware Acceleration setting causes the Discord client to quit and re-launch, so it is best practice to invoke this command as soon as possible, so users do not begin the experience of an application before restarting. Ideally, this is immediately after `await discordSdk.ready()`.

#### Usage

```javascript
import {DiscordSDK} from '@discord/embedded-app-sdk';
const discordSdk = new DiscordSDK(clientId);
await discordSdk.ready();
const {enabled} = await discordSdk.commands.encourageHardwareAcceleration();
console.log(`Hardware Acceleration is ${enabled === true ? 'enabled' : 'disabled'}`);
```

#### User Experience

![encourage-hardware-acceleration-modal](/images/activities/encourage-hardware-acceleration-modal.png)


================================================
FILE: developers/activities/development-guides.mdx
================================================
---
title: Activity Development Guides Index
sidebarTitle: Guide Index
description: Development guides for building Discord Activities with the Embedded App SDK.
---

These guides include suggested development practices, SDK commands, and user flows for you to consider while building your Activity. These will help to provide your users with a consistent and clear experience while interacting with your application.

## Local Development
<CardGroup cols={3}>
  <Card title="Run Your Application Locally" href="/developers/activities/development-guides/local-development#run-your-application-locally">
    Get up and running with a local development application.
  </Card>
  <Card title="Launch Your App from Discord" href="/developers/activities/development-guides/local-development#launch-your-application-from-the-discord-client">
    How to launch your app on mobile and desktop Discord clients.
  </Card>
  <Card title="Setup URL Mapping" href="/developers/activities/development-guides/local-development#url-mapping">
    Configure the Discord proxy to allow network requests to necessary external endpoints.
  </Card>
  <Card title="Logging" href="/developers/activities/development-guides/local-development#logging">
    How to use the various levels of logging while building your application.
  </Card>
</CardGroup>

## User Actions
<CardGroup cols={3}>
  <Card title="Open External Link" href="/developers/activities/development-guides/user-actions#open-external-link">
    Open an external link from within your app.
  </Card>
  <Card title="Open Invite Dialog" href="/developers/activities/development-guides/user-actions#open-invite-dialog">
    Open the Application Channel Invite dialog within Discord.
  </Card>
  <Card title="Open Share Moment Dialog" href="/developers/activities/development-guides/user-actions#open-share-moment-dialog">
    Open a dialog to share media from your application to a channel, DM, or GDM.
  </Card>
  <Card title="Setting Up an Entry Point Command" href="/developers/activities/development-guides/user-actions#setting-up-an-entry-point-command">
    Configure a command that allows users to open your Activity from the App Launcher.
  </Card>
  <Card title="Encourage Hardware Acceleration" href="/developers/activities/development-guides/user-actions#encourage-hardware-acceleration">
    Open a dialog to enable hardware acceleration for compute-intensive applications.
  </Card>
</CardGroup>

## Mobile
<CardGroup cols={3}>
  <Card title="Supporting Mobile Platforms" href="/developers/activities/development-guides/mobile#supported-platforms-web-ios-android">
    Update your application settings to support iOS and Android.
  </Card>
  <Card title="Mobile Safe Areas" href="/developers/activities/development-guides/mobile#mobile-safe-areas">
    Ensure that your app's assets fall within mobile-safe areas.
  </Card>
  <Card title="Mobile Thermal States" href="/developers/activities/development-guides/mobile#mobile-thermal-states">
    Respond to thermal state changes surfaced from iOS and Android.
  </Card>
</CardGroup>

## Layout
<CardGroup cols={3}>
  <Card title="Application Orientation" href="/developers/activities/development-guides/layout#application-orientation">
    Configure and subscribe to changes in application orientation.
  </Card>
  <Card title="Application Layout Mode" href="/developers/activities/development-guides/layout#application-layout-mode">
    Subscribe to layout mode changes to update your application's user interface.
  </Card>
</CardGroup>

## Networking
<CardGroup cols={3}>
  <Card title="Activity Proxy Considerations" href="/developers/activities/development-guides/networking#activity-proxy-considerations">
    Working with our Activity Proxy
  </Card>
  <Card title="Construct a Full URL" href="/developers/activities/development-guides/networking#construct-a-full-url">
    Generate a full URL when working with network requests.
  </Card>
  <Card title="Using External Resources" href="/developers/activities/development-guides/networking#using-external-resources">
    Allow network requests to external resources from inside the Discord proxy.
  </Card>
  <Card title="Security Considerations" href="/developers/activities/development-guides/networking#security-considerations">
    Keep things safe and secure in your Activity.
  </Card>
</CardGroup>

## Multiplayer Experience
<CardGroup cols={3}>
  <Card title="Instance Management" href="/developers/activities/development-guides/multiplayer-experience#activity-instance-management">
    Managing instances to ensure users join the same instance as their friends.
  </Card>
  <Card title="Instance Participants" href="/developers/activities/development-guides/multiplayer-experience#instance-participants">
    Use the SDK to fetch the users currently connected to an instance.
  </Card>
  <Card title="Render Avatars and Names" href="/developers/activities/development-guides/multiplayer-experience#render-avatars-and-names">
    Retrieve and render the usernames and avatars of users connected to your application.
  </Card>
  <Card title="Preventing Unwanted Activity Sessions" href="/developers/activities/development-guides/multiplayer-experience#preventing-unwanted-activity-sessions">
    Validating activity sessions are via a Discord client before adding them to an instance's session.
  </Card>
</CardGroup>

## Growth and Referrals
<CardGroup cols={3}>
  <Card title="Prompting Users to Share Incentivized Links" href="/developers/activities/development-guides/growth-and-referrals#prompting-users-to-share-incentivized-links">
    Encourage your users to share links to your activity by adding tracking and offering rewards for engagement.
  </Card>

  <Card title="Creating and Managing Custom Incentivized Links" href="/developers/activities/development-guides/growth-and-referrals#creating-and-managing-custom-incentivized-links">
    For off-platform sharing of rewards, promotions, or limited time experiences.
  </Card>

  <Card title="Generating a Custom Link Within Your Activity" href="/developers/activities/development-guides/growth-and-referrals#generating-a-custom-link-within-your-activity">
    An API to be able to generate ephemeral links with a customizable embed.
  </Card>
</CardGroup>

## Assets & Metadata
<CardGroup cols={3}>
  <Card title="Setting Up Activity Metadata" href="/developers/activities/development-guides/assets-and-metadata#setting-up-activity-metadata">
    Best practices for configuring how your application shows up in Discord.
  </Card>
   <Card title="Setting Up Art Assets" href="/developers/activities/development-guides/assets-and-metadata#setting-up-activity-art-assets">
    Best practices for configuring how your application shows up in Discord.
  </Card>
</CardGroup>

## Rich Presence
<CardGroup cols={2}>
  <Card title="Integrating Rich Presence" href="/developers/rich-presence/using-with-the-embedded-app-sdk">
    Display live activity data on user profiles while they play your Activity.
  </Card>
  <Card title="Rich Presence Best Practices" href="/developers/rich-presence/best-practices">
    Design tips and a launch checklist for a polished Rich Presence integration.
  </Card>
</CardGroup>

## Production Readiness
<CardGroup cols={3}>
  <Card title="Cache Busting" href="/developers/activities/development-guides/production-readiness#cache-busting">
    Manage asset caching in your application and the Discord Activity proxy.
  </Card>
  <Card title="Handling Rate Limits" href="/developers/activities/development-guides/production-readiness#handling-rate-limits">
    Stay within rate limits to keep the fun going in your Activity.
  </Card>
  <Card title="Static IP Addresses" href="/developers/activities/development-guides/production-readiness#static-ip-addresses">
    Network routing considerations when preparing your Activity for production use.
  </Card>
  <Card title="Backward Compatibility" href="/developers/activities/development-guides/production-readiness#backward-compatibility">
    Future-proof your application and support new commands as they become available in the SDK.
  </Card>
</CardGroup>


================================================
FILE: developers/activities/how-activities-work.mdx
================================================
---
title: How Activities Work
description: Understand the technical architecture and lifecycle of Discord Activities.
---


Activities are web applications that run in an iframe within Discord on desktop, mobile and web. In order to achieve this, we use the [`postMessage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) protocol to enable secure communication between your application and Discord.

The [Embedded App SDK](https://github.com/discord/embedded-app-sdk) simplifies this process by managing the `postMessage` protocol on your behalf. For details on available commands and their usage, consult the [SDK Reference](/developers/developer-tools/embedded-app-sdk). Our [Sample Projects](/developers/activities/overview#sample-projects) provide practical examples of how to implement these features.

## Launching Activities

After you have Activities enabled in your Application's [Activity's settings](https://discord.com/developers/applications/select/embedded/settings), your app can launch Activities in two ways:
1. When a user invokes your app's Entry Point command in the App Launcher
2. By responding to an interaction with the `LAUNCH_ACTIVITY` callback type

Each of these are covered in more detail in the below sections.

### Entry Point Command

Activities are primarily opened when users invoke your app's [Entry Point command](/developers/interactions/application-commands#entry-point-commands) in the App Launcher.

When you enable Activities for your app, a [default Entry Point command](/developers/interactions/application-commands#default-entry-point-command) called "Launch" is created for you. By default, Discord automatically handles opening your Activity when your Entry Point command is run by a user.

Read more about setting up Entry Point commands in the [development guide](/developers/activities/development-guides/user-actions#setting-up-an-entry-point-command).

### Interaction Response

Activities can be launched in response to [command](/developers/interactions/overview#commands), [message component](/developers/interactions/overview#message-components), and [modal submission](/developers/interactions/overview#modals) interactions. To open an Activity, set the callback type to `LAUNCH_ACTIVITY` (type `12`) when [responding to the interaction](/developers/interactions/receiving-and-responding#responding-to-an-interaction).

---

## Designed for Single-Page Apps (SPAs)

This SDK is intended for use by a single-page application. We recognize developers may be using frameworks or approaches that are not an exact fit for single-page applications. We recommend nesting those frameworks inside your Activity's top-level single-page application and passing messages as you see fit. Please refer to the [Nested Messages App](/developers/activities/overview#sample-projects) sample project for guidance on this approach.

## Activity Lifecycle

1. **Initialization:** When your iframe is loaded within Discord, it will include unique query parameters in its URL. These parameters are identifiable by your application using the Discord SDK.
2. **Handshake Process:** Constructing the SDK instance begins a handshake process with the Discord client. Once the connection is established, the iframe receives a `[FRAME, {evt: 'READY', ...}]` message. The `ready()` method of the SDK instance resolves once a successful connection has been established.
3. **Authorization and Authentication:** After receiving the `READY` payload, your application should perform authorization and authentication to acquire necessary permissions (scopes). This step is crucial for utilizing specific features or scopes, such as `rpc.activities.write`.
4. **Interacting with Discord Client:** Post-authentication, your application can subscribe to events and send commands to the Discord client. Note that attempting to use commands or subscribe to events outside your granted scope will result in errors. Adding new scopes may prompt an OAuth modal for user permission re-confirmation.
5. **Disconnection and Errors:** Receiving a `[CLOSE, {message: string, code: number}]` message indicates an error or a need to restart the connection process.
6. **Sending Errors or Close Requests:** To communicate an error or request a close from the Discord client, send `[CLOSE, {message?: string, code: number}]`. A code other than CLOSE_NORMAL will display the message to the user, while CLOSE_NORMAL results in a silent closure.

## Sample Code and Activity Lifecycle Diagram

<Info>
Below is a minimal example of setting up the SDK. Please see our [Sample Projects](/developers/activities/overview#sample-projects) for more complete sample applications.
</Info>

```javascript
import {DiscordSDK} from '@discord/embedded-app-sdk';
const discordSdk = new DiscordSDK(YOUR_OAUTH2_CLIENT_ID);

async function setup() {
  // Wait for READY payload from the discord client
  await discordSdk.ready();

  // Pop open the OAuth permission modal and request for access to scopes listed in scope array below
  const {code} = await discordSdk.commands.authorize({
    client_id: YOUR_OAUTH2_CLIENT_ID,
    response_type: 'code',
    state: '',
    prompt: 'none',
    scope: ['identify'],
  });

  // Retrieve an access_token from your application's server
  const response = await fetch('/.proxy/api/token', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      code,
    }),
  });
  const {access_token} = await response.json();

  // Authenticate with Discord client (using the access_token)
  auth = await discordSdk.commands.authenticate({
    access_token,
  });
}
```

This diagram illustrates the communication flow between your application and Discord in the sample code above.

![Diagram of how Activities communicate with Discord](/images/activities/embedded-app-flow-diagram.svg)


================================================
FILE: developers/activities/overview.mdx
================================================
---
title: Activities Overview
sidebarTitle: Overview
description: Learn about Discord Activities - multiplayer games and social experiences.
---

![Building Discord Activities](/images/activities/activities-hero.png)

Activities are web apps hosted in an iframe that use the [Embedded App SDK](/developers/activities/overview#embedded-app-sdk) to communicate with Discord clients. For an introduction to what Activities are, see the [Activities](/developers/platform/activities) platform page.

This section covers how Activities are built. You can explore real-world Activities by reading some of our [developer case studies](https://discord.com/build#case-studies), or jump right into building using the resources below.

<CardGroup cols={3}>
  <Card title="Build Your First Discord Activity" href="/developers/activities/building-an-activity">
    Follow the guide to build your first Activity using the Embedded App SDK.
  </Card>
  <Card title="Development Patterns" href="/developers/activities/development-guides">
    Explore common development patterns and practices to make building Activities simpler.
  </Card>
  <Card title="How Activities Work" href="/developers/activities/how-activities-work">
    Learn more about the lifecycle of Activities and how they run in Discord clients.
  </Card>
</CardGroup>

---

## Developing Activities

Whether you're developing a multiplayer game, a new social experience, or another creative idea, your Activity will be built as a web app that is run in an iframe in Discord on desktop, mobile, and web. You can get started by following the guide on [Building an Activity using the Embedded App SDK](/developers/activities/building-an-activity) or exploring the [sample projects](/developers/activities/overview#sample-projects)

The sections below provide an overview of the Embedded App SDK, but technical details about how Activities are run in Discord is covered in [How Activities Work](/developers/activities/how-activities-work).

### Embedded App SDK

The [Embedded App SDK](/developers/developer-tools/embedded-app-sdk) handles all of the communication between Discord and your app, making it easier to do common tasks like managing connected users, supporting mobile clients, and debugging your Activity.

The Embedded App SDK offers different events and commands to handle the communication between Discord and your Activity, which are covered more below.

#### Commands

The SDK has a set of commands you can call to interact with a Discord client, given you have the appropriate scopes. This is helpful when you want to do authorize and authenticate users, fetch information about your Activity, or update information for your Activity or an authenticated user.

Read the [Embedded App SDK documentation](/developers/developer-tools/embedded-app-sdk#sdk-commands) for a full list of commands, and details about each command.

#### Events

The SDK also has events you can subscribe (or unsubscribe) to for things happening in a connected client that are relevant to your Activity, given you have the appropriate scopes. This is helpful when you want to do things like handle initial connection and thrown errors, listen to updates about a connected user, and listen to events related to your Activity instance.

Read the [Embedded App SDK documentation](/developers/developer-tools/embedded-app-sdk#sdk-events) for a full list of events, and details for each event.


---

## Sample Projects

Use the sample projects we've built to help you get started building quickly and learn from common development patterns.

You can also find a list of community-maintained samples on [GitHub](https://github.com/discord/embedded-app-sdk-examples?tab=readme-ov-file#community-curated-examples), which includes more framework-specific examples.

<CardGroup cols={3}>
  <Card title="Discord Activity Starter" href="https://github.com/discord/embedded-app-sdk-examples/tree/main/discord-activity-starter">
    This TypeScript starter template is perfect for getting your own Activity up and running quickly.
  </Card>
  <Card title="Embedded App SDK Playground" href="https://github.com/discord/embedded-app-sdk-examples/tree/main/sdk-playground">
    This reference example implements the commands and events available to you within the Embedded App SDK.
  </Card>
  <Card title="Nested Framework App" href="https://github.com/discord/embedded-app-sdk-examples/tree/main/nested-messages">
    This reference example demonstrates an Activity using a nested framework like a game engine.
  </Card>
</CardGroup>


================================================
FILE: developers/bots/overview.mdx
================================================
---
title: Discord Bots & Companion Apps
sidebarTitle: Overview
description: Start building bots and companion apps for Discord.
---

import {WrenchIcon} from '/snippets/icons/WrenchIcon.jsx'
import {RobotIcon} from '/snippets/icons/RobotIcon.jsx'
import {YouTubeEmbed} from '/snippets/youtube.jsx'

<img
  src="/images/headers/docs-botsapp-hero.png"
  alt="Discord Bots & Companion Apps Hero Image"
   style={{width: "100%", height: "auto"}}
  noZoom
/>

Bots are applications that connect to Discord using the Discord API. They appear in servers as users with an `APP` tag and can interact with members, respond to events, and perform actions programmatically. For a deeper look at what bots can do and when to use one, see the [Bots & Companion Apps](/developers/platform/bots) platform page.

## Getting Started

To build a bot, you'll need to:

- **Create an application** in the Discord Developer Portal. This is where your bot token, OAuth2 credentials, and configuration live.
- **Add a bot user** to your application from the Bot tab. This generates the token your code uses to authenticate.
- **Invite the bot** to a server using an OAuth2 URL with the bot scope and the permissions your bot requires.
- **Connect to the API** using the Gateway for real-time events, the HTTP API for REST operations, or both.

Most developers use a community-maintained library in their language of choice rather than interfacing with the API directly. Official and community libraries are listed in the [Community Resources](/developers/developer-tools/community-resources) page.

If you're ready to dive in, the [Getting Started guide](/developers/quick-start/getting-started) walks through building and running your first bot end to end.

## Building Your Bot

- **[Interactions](/developers/interactions/overview)** — Slash commands, context menu commands, buttons, select menus, and modals that let users interact with your bot.
- **[Components](/developers/components/overview)** — Layout, content, and interactive UI elements you can attach to messages and modals.
- **[Monetization](/developers/monetization/overview)** — Add subscriptions and one-time purchases to your bot using Discord's built-in payment flow.
- **[Discovery](/developers/discovery/overview)** — Get your app listed in the App Directory and App Launcher so users can find and install it.
- **[Guides & Tutorials](/developers/guides/bots)** — Practical guides on implementing common bot features and best practices.

## Next Steps

<YouTubeEmbed
        src="https://www.youtube.com/embed/HgW_1651VeM"
        title="Building a Bot to Connect Your Game to Your Discord Community | 2026 GDC Discord Booth Talk"
        showDuration
/>

<CardGroup cols={2}>
  <Card
    title="Build Your First App"
    href="/developers/quick-start/getting-started"
    icon={<WrenchIcon />}
  >
    Step-by-step guide to building and running your first Discord bot.
  </Card>
  <Card
    title="Bot Development Guides"
    href="/developers/guides/bots"
    icon={<RobotIcon />}
  >
    Explore guides on implementing common bot features and best practices.
  </Card>
</CardGroup>


================================================
FILE: developers/change-log.mdx
================================================
---
title: "Change Log"
description: "Discover the latest updates, new features, and bug fixes on the Discord Developer Platform. To join in on the conversation, join the [Discord Developers Server](https://discord.com/invite/discord-developers)."
rss: true
---

import {Route} from '/snippets/route.jsx'

<Update label="November 23, 2026" tags={["HTTP API"]} rss={{
    title: "Audio Link Previews",
    description: "Direct links to audio files now display an inline audio player on web, desktop, and mobile."
}}>

    ## Audio Link Previews

    Direct links to audio files now generate embeds with an inline audio player on web, desktop, and mobile.

    #### Developer Resources
    - [Audio Link Previews](/developers/link-previews/overview#audio)
    - [Embed Types](/developers/resources/message#embed-object-embed-types)
    - [Embed Audio Structure](/developers/resources/message#embed-object-embed-audio-structure)
</Update>

<Update label="November 19, 2026" tags={["Breaking Change", "Discord Social SDK"]} rss={{
    title: "Game Deauthorization Removes Game Relationships",
    description: "Permanently revoking a Social SDK game's authorization now removes all of its game relationships from the player's Discord account."
}}>

    ## Game Deauthorization Removes Game Relationships

    Permanently revoking a Social SDK game's authorization now removes all of its game relationships from the player's Discord account. Previously, relationships that could not transfer to a provisional account could remain on the original account.

    Game friends and incoming or outgoing game friend requests move to the new provisional account only if the friend's Discord account is still authorized for your game with the `sdk.social_layer` or `sdk.social_layer_presence` scope. Transfers can also fail because of blocks or game relationship limits. Relationships that do not transfer are deleted. Ordinary Discord friendships are not affected.

    Temporary bans are unchanged: relationships that can't transfer stay on the original account.

    ### What Do You Need to Do?

    - Update any unlinking or relinking flows that assume game friendships or friend requests remain on the original Discord account after authorization is revoked.

    #### Developer Resources
    - [Unlinking Accounts](/developers/discord-social-sdk/development-guides/unlinking-accounts#always-revoke-tokens-when-unlinking)
    - [Data Migration During Unmerging](/developers/discord-social-sdk/development-guides/provisional-accounts/unmerging-accounts#data-migration-during-unmerging)
</Update>

<Update label="November 17, 2026" tags={["Discord Social SDK"]} rss={{
    title: "Discord Social SDK Release 1.11.24259",
    description: "Xbox GDK 261000 and PS5 SDK 14.000 support with new console minimums, Krisp noise cancellation on Xbox Series X|S, a macOS 12.0 minimum, and Rich Presence and noise suppression fixes."
  }}>

    ## Discord Social SDK Release 1.11.24259

    A new release of the Discord Social SDK is now available, with the following updates:

    ### Rich Presence
    - Fixed presence updates being ignored when only [`Activity::SetSupportedPlatforms`] changed
    - [`Client::SetApplicationId`] now immediately updates presence sent to the Discord desktop client, helping it identify the running game

    ### Noise Suppression
    - Fixed the previous noise suppression setting not being restored when Krisp fails to initialize
    - Fixed a race condition during voice initialization that could apply outdated noise suppression or noise cancellation settings

    ### iOS
    - Fixed the Krisp xcframework shipping an empty binary with an incorrect framework name, and ensured Unreal applications embed the framework

    ### Xbox
    - Added Xbox GDK 261000 support and dropped support for GDK 241000; the new minimum supported GDK version is 250400
    - Added Krisp noise cancellation on Xbox Series X|S, with runtime libraries and models included in standalone, Unity, and Unreal packages

    ### PlayStation 5
    - Added PS5 SDK 14.000 support and dropped support for SDK versions 10.000 and 11.000; the new minimum supported version is 12.000

    ### macOS
    - Raised the minimum supported macOS version from 10.15 to 12.0

    ### Unreal Engine
    - Fixed monolithic-header warnings when integrating the Unreal plugin

    ### Upcoming Deprecations
    - Xbox GDK 250400 support is planned to be removed in April 2027
    - PS5 SDK 12.000 support is planned to be removed in April 2027

    ### Supported Versions
    The five most recent minor versions of the Social SDK, including the latest release, receive hotfix patches (bug fixes and security fixes). With this release, the [supported version window](/developers/discord-social-sdk/core-concepts/release-cadence-and-support#supported-versions) covers versions **1.7 through 1.11**. Version **1.6** is now end-of-life and no longer eligible for patch updates.

    See [Platform Compatibility](/developers/discord-social-sdk/core-concepts/platform-compatibility) for the full list of supported platform versions.
</Update>

<Update label="November 16, 2026" tags={["Breaking Change", "Gateway", "HTTP API"]} rss={{
    title: "Channel Obfuscation is Now Live for All Bots",
    description: "Bots no longer receive full metadata for channels they can't view."
}}>

    ## Channel Obfuscation is Now Live for All Bots

    As [announced in August](/developers/change-log#channel-obfuscation-for-users-and-bots), channel obfuscation is now rolling out to all bots. Bots no longer receive full metadata for channels they lack `VIEW_CHANNEL` on, matching what users can see. If your bot only acts in channels it has permission to view, this change does not affect you.

    - **Over the Gateway**, channels your bot can't view are still dispatched, but with sensitive fields obfuscated. The channel's `name` is `"___hidden___"`, the [`CHANNEL_OBFUSCATED` flag](/developers/resources/channel#channel-object-channel-flags) (`1 << 17`) is set on its `flags`, and `permission_overwrites` contains a single overwrite denying `VIEW_CHANNEL` for `@everyone`.
    - **Over HTTP**, [`GET /guilds/{guild.id}/channels`](/developers/resources/guild#get-guild-channels) omits those channels from the response entirely.

    When your bot gains access to an obfuscated channel, the Gateway dispatches a [Channel Update](/developers/events/gateway-events#channel-update) event with the full channel data. [Interaction](/developers/interactions/receiving-and-responding) payloads are not obfuscated.

    ### What Do You Need to Do?

    - Use the `CHANNEL_OBFUSCATED` flag to detect obfuscated channels. Don't rely on `name` or other obfuscated fields.

    #### Developer Resources
    - [Obfuscated Channels](/developers/resources/channel#channel-object-obfuscated-channels)
    - [Channel Flags](/developers/resources/channel#channel-object-channel-flags)
    - [Get Guild Channels](/developers/resources/guild#get-guild-channels)
    - [Channel Visibility](/developers/topics/permissions#channel-visibility)
</Update>

<Update label="October 30, 2026" tags={["HTTP API"]} rss={{
    title: "New Endpoints for getting member and role permissions for guilds and channels",
    description: "You can now get a member or role's permissions for a guild or channel without calculating them yourself, using the new Get Guild Member Permissions, Get Guild Role Permissions, Get Channel Member Permissions, and Get Channel Role Permissions endpoints."
}}>

    ## New Endpoints for getting member and role permissions for guilds and channels

    We've added four new endpoints to get a member or role's permissions for a guild or channel.

    The channel endpoints apply [implicit permission masking](/developers/topics/permissions#implicit-permissions) by default. Set `implicit=false` to skip this masking.

    #### Developer Resources
    - [Get Guild Member Permissions](/developers/resources/guild#get-guild-member-permissions)
    - [Get Guild Role Permissions](/developers/resources/guild#get-guild-role-permissions)
    - [Get Channel Member Permissions](/developers/resources/channel#get-channel-member-permissions)
    - [Get Channel Role Permissions](/developers/resources/channel#get-channel-role-permissions)
</Update>

<Update label="October 29, 2026" tags={["HTTP API", "Documentation"]} rss={{
    title: "Voice Channel Status Permission Clarification",
    description: "Users connected to a voice channel can set its status with SET_VOICE_CHANNEL_STATUS even without CONNECT."
}}>

    ## Voice Channel Status Permission Clarification

    Users already connected to a voice channel can now set the channel's status with the `SET_VOICE_CHANNEL_STATUS` permission even if they do not have `CONNECT`. Previously, a denied `CONNECT` implicitly removed `SET_VOICE_CHANNEL_STATUS`. Users not connected to the channel still need `MANAGE_CHANNELS` as well.

    #### Developer Resources
    - [Set Voice Channel Status](/developers/resources/channel#set-voice-channel-status)
    - [Implicit Permissions](/developers/topics/permissions#implicit-permissions)
</Update>

<Update label="October 29, 2026" tags={["HTTP API", "Gateway"]} rss={{
    title: "Channel and Role Position Update Audit Logs",
   
discord-api-docs/

├── .gitattributes
├── .github/
│   ├── CODEOWNERS
│   ├── ISSUE_TEMPLATE/
│   │   ├── api-bug-report.yml
│   │   ├── app-subscriptions-bug-report.yml
│   │   ├── config.yml
│   │   ├── developer-site-bug-report.yml
│   │   ├── message-components-bug-report.yml
│   │   └── slash-command-bug-report.yml
│   ├── dependabot.yml
│   └── workflows/
│       ├── docs.yaml
│       └── test.yaml
├── .gitignore
├── .husky/
│   └── pre-commit
├── .mintignore
├── .vale.ini
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── LICENSE-CODE
├── README.md
├── developers/
│   ├── activities/
│   │   ├── building-an-activity.mdx
│   │   ├── design-patterns.mdx
│   │   ├── development-guides/
│   │   │   ├── assets-and-metadata.mdx
│   │   │   ├── growth-and-referrals.mdx
│   │   │   ├── layout.mdx
│   │   │   ├── local-development.mdx
│   │   │   ├── mobile.mdx
│   │   │   ├── multiplayer-experience.mdx
│   │   │   ├── networking.mdx
│   │   │   ├── production-readiness.mdx
│   │   │   └── user-actions.mdx
│   │   ├── development-guides.mdx
│   │   ├── how-activities-work.mdx
│   │   └── overview.mdx
│   ├── bots/
│   │   └── overview.mdx
│   ├── change-log.mdx
│   ├── communities/
│   │   └── guides/
│   │       └── community-invites.mdx
│   ├── components/
│   │   ├── overview.mdx
│   │   ├── reference.mdx
│   │   ├── using-message-components.mdx
│   │   └── using-modal-components.mdx
│   ├── developer-tools/
│   │   ├── community-resources.mdx
│   │   ├── embedded-app-sdk.mdx
│   │   └── game-sdk.mdx
│   ├── discord-social-sdk/
│   │   ├── core-concepts/
│   │   │   ├── communication-features.mdx
│   │   │   ├── core-features.mdx
│   │   │   ├── integration-overview.mdx
│   │   │   ├── mobile.mdx
│   │   │   ├── oauth2-scopes.mdx
│   │   │   ├── platform-compatibility.mdx
│   │   │   └── release-cadence-and-support.mdx
│   │   ├── core-concepts.mdx
│   │   ├── design-guidelines/
│   │   │   ├── branding-guidelines.mdx
│   │   │   ├── chat-history.mdx
│   │   │   ├── connection-points.mdx
│   │   │   ├── consoles.mdx
│   │   │   ├── direct-messages.mdx
│   │   │   ├── game-friends.mdx
│   │   │   ├── linked-channels.mdx
│   │   │   ├── principles.mdx
│   │   │   ├── provisional-accounts.mdx
│   │   │   ├── signing-in.mdx
│   │   │   ├── social-settings.mdx
│   │   │   ├── status-rich-presence.mdx
│   │   │   └── unified-friends-list.mdx
│   │   ├── design-guidelines.mdx
│   │   ├── development-guides/
│   │   │   ├── account-linking-from-discord.mdx
│   │   │   ├── account-linking-on-consoles.mdx
│   │   │   ├── account-linking-on-mobile.mdx
│   │   │   ├── account-linking-on-web.mdx
│   │   │   ├── account-linking-with-discord.mdx
│   │   │   ├── creating-a-unified-friends-list.mdx
│   │   │   ├── linked-channels.mdx
│   │   │   ├── managing-game-invites.mdx
│   │   │   ├── managing-lobbies.mdx
│   │   │   ├── managing-relationships.mdx
│   │   │   ├── managing-voice-chat.mdx
│   │   │   ├── provisional-accounts/
│   │   │   │   ├── bot-token-endpoint.mdx
│   │   │   │   ├── external-credentials-exchange.mdx
│   │   │   │   ├── identity-providers.mdx
│   │   │   │   ├── managing-accounts.mdx
│   │   │   │   ├── merging-accounts.mdx
│   │   │   │   ├── overview.mdx
│   │   │   │   ├── public-client.mdx
│   │   │   │   └── unmerging-accounts.mdx
│   │   │   ├── publisher-level-account-linking.mdx
│   │   │   ├── sending-direct-messages.mdx
│   │   │   ├── setting-rich-presence.mdx
│   │   │   └── unlinking-accounts.mdx
│   │   ├── development-guides.mdx
│   │   ├── getting-started/
│   │   │   ├── partials/
│   │   │   │   ├── dylib-mac-error.mdx
│   │   │   │   └── getting-started.mdx
│   │   │   ├── using-c++.mdx
│   │   │   ├── using-unity.mdx
│   │   │   └── using-unreal-engine.mdx
│   │   ├── getting-started.mdx
│   │   ├── how-to/
│   │   │   ├── debug-log.mdx
│   │   │   ├── handle-rate-limits.mdx
│   │   │   ├── handle-special-characters-display-names.mdx
│   │   │   ├── integrate-moderation.mdx
│   │   │   ├── market-your-integration.mdx
│   │   │   ├── use-with-discord-apis.mdx
│   │   │   └── voice-muting-for-blocked-players.mdx
│   │   ├── how-to.mdx
│   │   ├── overview.mdx
│   │   ├── partials/
│   │   │   └── callouts/
│   │   │       ├── console-access.mdx
│   │   │       ├── oauth-comms-scopes.mdx
│   │   │       ├── public-client.mdx
│   │   │       ├── rate-limit.mdx
│   │   │       ├── sony.mdx
│   │   │       └── support.mdx
│   │   └── social-sdk-reference.mdx
│   ├── discovery/
│   │   ├── best-practices.mdx
│   │   ├── enabling-discovery.mdx
│   │   └── overview.mdx
│   ├── events/
│   │   ├── gateway-events.mdx
│   │   ├── gateway.mdx
│   │   ├── overview.mdx
│   │   └── webhook-events.mdx
│   ├── game-development/
│   │   ├── how-to-add-proximity-voice-chat-to-your-game.mdx
│   │   ├── how-to-create-a-community-for-your-game.mdx
│   │   ├── how-to-get-your-game-seen.mdx
│   │   ├── how-to-grow-your-game.mdx
│   │   └── how-to-keep-your-players-engaged.mdx
│   ├── gateway/
│   │   ├── getting-started-with-privileged-intent-review.mdx
│   │   └── you-might-not-need-a-privileged-intent.mdx
│   ├── guides/
│   │   ├── activities.mdx
│   │   ├── bots.mdx
│   │   ├── communities.mdx
│   │   ├── game-development.mdx
│   │   ├── platform.mdx
│   │   └── social-sdk.mdx
│   ├── guides.mdx
│   ├── interactions/
│   │   ├── application-commands.mdx
│   │   ├── overview.mdx
│   │   └── receiving-and-responding.mdx
│   ├── intro.mdx
│   ├── link-previews/
│   │   ├── component-embeds.mdx
│   │   └── overview.mdx
│   ├── monetization/
│   │   ├── enabling-monetization.mdx
│   │   ├── implementing-app-subscriptions.mdx
│   │   ├── implementing-iap-for-activities.mdx
│   │   ├── implementing-one-time-purchases.mdx
│   │   ├── managing-skus.mdx
│   │   └── overview.mdx
│   ├── platform/
│   │   ├── account-linking.mdx
│   │   ├── activities.mdx
│   │   ├── app-monetization.mdx
│   │   ├── bots.mdx
│   │   ├── claim-your-game.mdx
│   │   ├── community-servers.mdx
│   │   ├── components.mdx
│   │   ├── discovery.mdx
│   │   ├── game-profiles.mdx
│   │   ├── interactions.mdx
│   │   ├── oauth2-and-permissions.mdx
│   │   ├── rich-presence.mdx
│   │   ├── server-and-channel-management.mdx
│   │   ├── social-layer.mdx
│   │   └── webhooks.mdx
│   ├── policies/
│   │   ├── developer-policy.mdx
│   │   └── developer-terms-of-service.mdx
│   ├── quick-start/
│   │   ├── getting-started.mdx
│   │   └── overview-of-apps.mdx
│   ├── reference.mdx
│   ├── resources/
│   │   ├── application-identity-profile.mdx
│   │   ├── application-role-connection-metadata.mdx
│   │   ├── application.mdx
│   │   ├── audit-log.mdx
│   │   ├── auto-moderation.mdx
│   │   ├── channel.mdx
│   │   ├── emoji.mdx
│   │   ├── entitlement.mdx
│   │   ├── guild-scheduled-event.mdx
│   │   ├── guild-template.mdx
│   │   ├── guild.mdx
│   │   ├── invite.mdx
│   │   ├── lobby.mdx
│   │   ├── message.mdx
│   │   ├── poll.mdx
│   │   ├── sku.mdx
│   │   ├── soundboard.mdx
│   │   ├── stage-instance.mdx
│   │   ├── sticker.mdx
│   │   ├── subscription.mdx
│   │   ├── user.mdx
│   │   ├── voice.mdx
│   │   └── webhook.mdx
│   ├── rich-presence/
│   │   ├── best-practices.mdx
│   │   ├── overview.mdx
│   │   └── using-with-the-embedded-app-sdk.mdx
│   ├── social-commerce/
│   │   └── overview.mdx
│   ├── social-layer/
│   │   └── game-stats-widgets/
│   │       ├── best-practices.mdx
│   │       ├── overview.mdx
│   │       ├── sending-game-data.mdx
│   │       └── widget-configuration.mdx
│   ├── topics/
│   │   ├── certified-devices.mdx
│   │   ├── oauth2.mdx
│   │   ├── opcodes-and-status-codes.mdx
│   │   ├── permissions.mdx
│   │   ├── rate-limits.mdx
│   │   ├── rpc.mdx
│   │   ├── teams.mdx
│   │   ├── threads.mdx
│   │   └── voice-connections.mdx
│   └── tutorials/
│       ├── configuring-app-metadata-for-linked-roles.mdx
│       ├── developing-a-user-installable-app.mdx
│       ├── hosting-on-cloudflare-workers.mdx
│       └── using-community-invites.mdx
├── docs.json
├── package.json
├── scripts/
│   └── docs.js
├── snippets/
│   ├── card.mdx
│   ├── discord-social-sdk/
│   │   ├── callouts/
│   │   │   ├── console-access.mdx
│   │   │   ├── console-account-linking.mdx
│   │   │   ├── limited-access.mdx
│   │   │   ├── oauth-comms-scopes.mdx
│   │   │   ├── oauth-presence-scopes.mdx
│   │   │   ├── public-client.mdx
│   │   │   ├── rate-limit.mdx
│   │   │   ├── reuse-stored-token.mdx
│   │   │   ├── sony.mdx
│   │   │   └── support.mdx
│   │   └── partials/
│   │       ├── dylib-mac-error.mdx
│   │       ├── getting-started.mdx
│   │       ├── provisional-account-errors.mdx
│   │       └── provisional-account-oidc-errors.mdx
│   ├── icons/
│   │   ├── ActivitiesIcon.jsx
│   │   ├── AppsIcon.jsx
│   │   ├── BookCheckIcon.jsx
│   │   ├── BrowserIcon.jsx
│   │   ├── BugIcon.jsx
│   │   ├── ChatDotsIcon.jsx
│   │   ├── ChatIcon.jsx
│   │   ├── CircleQuestionIcon.jsx
│   │   ├── ClydeIcon.jsx
│   │   ├── CompassIcon.jsx
│   │   ├── ContactsIcon.jsx
│   │   ├── CrownIcon.jsx
│   │   ├── DoorEnterIcon.jsx
│   │   ├── DpadIcon.jsx
│   │   ├── ForumIcon.jsx
│   │   ├── GameControllerIcon.jsx
│   │   ├── GlobeEarthIcon.jsx
│   │   ├── GroupIcon.jsx
│   │   ├── HammerIcon.jsx
│   │   ├── HashmarkIcon.jsx
│   │   ├── InboxIcon.jsx
│   │   ├── LettersIcon.jsx
│   │   ├── LinkIcon.jsx
│   │   ├── ListViewIcon.jsx
│   │   ├── MagicDoorIcon.jsx
│   │   ├── MagicWandIcon.jsx
│   │   ├── MobilePhoneIcon.jsx
│   │   ├── PaintPaletteIcon.jsx
│   │   ├── PhoneCallIcon.jsx
│   │   ├── PlayIcon.jsx
│   │   ├── RobotIcon.jsx
│   │   ├── ShapesIcon.jsx
│   │   ├── ShieldIcon.jsx
│   │   ├── ShopIcon.jsx
│   │   ├── SlashBoxIcon.jsx
│   │   ├── StarShootingIcon.jsx
│   │   ├── TextControllerIcon.jsx
│   │   ├── TrophyIcon.jsx
│   │   ├── UserIcon.jsx
│   │   ├── UserPlatformIcon.jsx
│   │   ├── UserPlusIcon.jsx
│   │   ├── UserStatusIcon.jsx
│   │   ├── VoiceNormalIcon.jsx
│   │   └── WrenchIcon.jsx
│   ├── imagecard.jsx
│   ├── linkbutton.jsx
│   ├── manualanchor.jsx
│   ├── monospace.jsx
│   ├── route.jsx
│   ├── snowflake.jsx
│   ├── youtube.jsx
│   └── youtubeplaylist.jsx
├── styles/
│   ├── fonts.css
│   ├── imagecard.css
│   ├── linkbutton.css
│   ├── monospace.css
│   ├── route.css
│   ├── snowflake.css
│   ├── theme.css
│   ├── variables.css
│   └── youtubeplaylist.css
├── tools/
│   ├── .prettierrc.json
│   ├── checkBuild.ts
│   ├── doxygen/
│   │   ├── decorate-social-sdk-references.js
│   │   ├── generate-social-sdk-mapping.js
│   │   └── social-sdk-mappings.json
│   ├── eslint.config.js
│   ├── find-unused-images.js
│   ├── optimize-images.js
│   ├── package.json
│   ├── parse-changelog.js
│   ├── rename-files.js
│   └── tsconfig.json
└── vale/
    └── config/
        └── vocabularies/
            ├── Discord/
            │   └── accept.txt
            └── Mintlify/
                └── accept.txt
SYMBOL INDEX (39 symbols across 6 files)

FILE: tools/checkBuild.ts
  constant ROOT_DIR (line 8) | const ROOT_DIR = path.join(import.meta.dirname, "..");
  constant DOCS_DIR (line 9) | const DOCS_DIR = path.join(ROOT_DIR, "developers");

FILE: tools/doxygen/decorate-social-sdk-references.js
  constant REPO_ROOT (line 9) | const REPO_ROOT = path.resolve(__dirname, "..", "..");
  constant MARKDOWN_DIR (line 10) | const MARKDOWN_DIR = path.join(REPO_ROOT, "/");
  constant MAPPING_FILE (line 11) | const MAPPING_FILE = path.join(__dirname, "social-sdk-mappings.json");

FILE: tools/doxygen/generate-social-sdk-mapping.js
  constant REPO_ROOT (line 11) | const REPO_ROOT = path.resolve(__dirname, "..", "..");
  constant XML_DIR (line 12) | const XML_DIR = path.join(__dirname, "xml_output");
  constant OUTPUT_JSON (line 13) | const OUTPUT_JSON = path.join(__dirname, "social-sdk-mappings.json");
  constant BASE_URL (line 14) | const BASE_URL = "https://discord.com/developers/docs/social-sdk";

FILE: tools/find-unused-images.js
  constant CONFIG (line 7) | const CONFIG = {
  class UnusedImageFinder (line 16) | class UnusedImageFinder {
    method constructor (line 17) | constructor(config) {
    method log (line 28) | log(message, level = "info") {
    method findFiles (line 39) | findFiles(dir, extensions) {
    method getAllImages (line 73) | getAllImages() {
    method getAllMarkupFiles (line 81) | getAllMarkupFiles() {
    method extractImageReferences (line 101) | extractImageReferences(filePath, content) {
    method normalizeImagePath (line 139) | normalizeImagePath(imagePath, referencingFile) {
    method scanForImageReferences (line 180) | scanForImageReferences() {
    method isImageReferenced (line 203) | isImageReferenced(imagePath) {
    method findUnusedImages (line 241) | findUnusedImages() {

FILE: tools/optimize-images.js
  constant CONFIG (line 8) | const CONFIG = {
  class ImageOptimizer (line 17) | class ImageOptimizer {
    method constructor (line 18) | constructor(config) {
    method log (line 35) | log(message, level = "info") {
    method setupReportDirectory (line 42) | setupReportDirectory() {
    method initializeHtmlReport (line 62) | initializeHtmlReport() {
    method copyOriginalToReport (line 163) | copyOriginalToReport(originalPath) {
    method addComparisonToReport (line 180) | addComparisonToReport(originalPath, convertedPath, originalSize, conve...
    method findFiles (line 212) | findFiles(dir, extensions) {
    method getFileSize (line 234) | getFileSize(filePath) {
    method convertImage (line 243) | async convertImage(inputPath, outputPath, quality = 85) {
    method optimizeSvg (line 267) | async optimizeSvg(filePath) {
    method updateMarkdownReferences (line 335) | updateMarkdownReferences(filePath, replacements) {
    method findImageReferences (line 360) | findImageReferences() {
    method optimize (line 409) | async optimize() {
    method finalizeHtmlReport (line 549) | finalizeHtmlReport() {
    method printSummary (line 664) | printSummary() {

FILE: tools/rename-files.js
  function renameFilesInDirectory (line 5) | async function renameFilesInDirectory(directory) {
Condensed preview — 302 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,834K chars).
[
  {
    "path": ".gitattributes",
    "chars": 167,
    "preview": "# automatically normalize line endings\n* text=auto\n\n.git* text\n*.json text\n*.js text\n*.md text linguist-detectable\n*.{ym..."
  },
  {
    "path": ".github/CODEOWNERS",
    "chars": 20,
    "preview": "*   @discord/devrel\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/api-bug-report.yml",
    "chars": 1638,
    "preview": "name: API Bug Report\ndescription: A bug has been found in Discord's API, Gateway, OAuth2, SDK, etc.\nlabels: [\"bug\"]\nbody..."
  },
  {
    "path": ".github/ISSUE_TEMPLATE/app-subscriptions-bug-report.yml",
    "chars": 1601,
    "preview": "name: App Subscriptions Bug Report\ndescription: A bug has been found in Discord's App Subscriptions.\nlabels: [\"bug\", \"pr..."
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "chars": 1141,
    "preview": "blank_issues_enabled: false\ncontact_links:\n  - name: API, Application Command, and Message Component Feature Requests..."
  },
  {
    "path": ".github/ISSUE_TEMPLATE/developer-site-bug-report.yml",
    "chars": 1622,
    "preview": "name: Developer Site Bug Report\ndescription: A bug has been found with Discord's Developer site or documentation.\nlabels..."
  },
  {
    "path": ".github/ISSUE_TEMPLATE/message-components-bug-report.yml",
    "chars": 1615,
    "preview": "name: Message Components Bug Report\ndescription: A bug has been found in Discord's Message Components.\nlabels: [\"bug\", \"..."
  },
  {
    "path": ".github/ISSUE_TEMPLATE/slash-command-bug-report.yml",
    "chars": 1616,
    "preview": "name: Slash Commands Bug Report\ndescription: A bug has been found in Discord's Slash Commands and Interactions.\nlabels:..."
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 446,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      interval: \"weekly\"..."
  },
  {
    "path": ".github/workflows/docs.yaml",
    "chars": 934,
    "preview": "name: Verify Docs Formatting\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n\npermissions:\n  contents: read\n\njob..."
  },
  {
    "path": ".github/workflows/test.yaml",
    "chars": 639,
    "preview": "name: ci\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n\npermissions:\n  contents: read\n\njobs:\n  lint:\n    name:..."
  },
  {
    "path": ".gitignore",
    "chars": 54,
    "preview": ".DS_Store\n*.swp\nnode_modules/\ndist/\n.idea\nxml_output/\n"
  },
  {
    "path": ".husky/pre-commit",
    "chars": 392,
    "preview": "# Ensure workspace dependencies are installed before linting.\n# Installs only when node_modules is missing or package-lo..."
  },
  {
    "path": ".mintignore",
    "chars": 159,
    "preview": "# Exclude directories\nresources/\ntools/\n\n# Exclude specific files\nLICENSE\nLICENSE-CODE\nCODE_OF_CONDUCT.md\n\n# Include dev..."
  },
  {
    "path": ".vale.ini",
    "chars": 870,
    "preview": "# Top level styles\nStylesPath = ./vale\nMinAlertLevel = suggestion\nIgnoredScopes = code, tt, img, url, a\nSkippedScopes =..."
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 5619,
    "preview": "# Code of Conduct\n\n## **Our Pledge**\n\nWe as members, contributors, and leaders pledge to make participation in our commu..."
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 1636,
    "preview": "# Contributing\n\nSee the [README](https://github.com/discord/discord-api-docs/blob/main/README.md) for licensing and lega..."
  },
  {
    "path": "LICENSE",
    "chars": 20127,
    "preview": "Attribution-ShareAlike 4.0 International\n\n=======================================================================\n\nCreat..."
  },
  {
    "path": "LICENSE-CODE",
    "chars": 1063,
    "preview": "MIT License\n\nCopyright (c) 2016 Discord\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of..."
  },
  {
    "path": "README.md",
    "chars": 2882,
    "preview": "# Discord for Developers Documentation\n\nThis repo contains the official Discord for Developers documentation, which can..."
  },
  {
    "path": "developers/activities/building-an-activity.mdx",
    "chars": 32638,
    "preview": "---\ntitle: Building Your First Activity in Discord\nsidebarTitle: Build Your First Activity\ndescription: Step-by-step tut..."
  },
  {
    "path": "developers/activities/design-patterns.mdx",
    "chars": 15769,
    "preview": "---\ntitle: Activity Design Patterns\nsidebarTitle: Design Patterns\ndescription: Best practices and design principles for..."
  },
  {
    "path": "developers/activities/development-guides/assets-and-metadata.mdx",
    "chars": 2681,
    "preview": "---\ntitle: Assets and Metadata\ndescription: Guide to managing Activity assets, metadata, and configuration.\n---\n\n## Sett..."
  },
  {
    "path": "developers/activities/development-guides/growth-and-referrals.mdx",
    "chars": 8621,
    "preview": "---\ntitle: Growth and Referrals\ndescription: Implement growth strategies and referral systems in Discord Activities.\n---..."
  },
  {
    "path": "developers/activities/development-guides/layout.mdx",
    "chars": 4520,
    "preview": "---\ntitle: Layout\ndescription: Design effective layouts and user interfaces for Discord Activities.\n---\n\n## Application..."
  },
  {
    "path": "developers/activities/development-guides/local-development.mdx",
    "chars": 11534,
    "preview": "---\ntitle: Local Development\nsidebarTitle: Local Development\ndescription: Set up local development environment for Disco..."
  },
  {
    "path": "developers/activities/development-guides/mobile.mdx",
    "chars": 3354,
    "preview": "---\ntitle: Mobile\ndescription: Design and optimize Discord Activities for mobile devices.\n---\n\n## Supported Platforms: W..."
  },
  {
    "path": "developers/activities/development-guides/multiplayer-experience.mdx",
    "chars": 11474,
    "preview": "---\ntitle: Multiplayer Experience\ndescription: Design and implement engaging multiplayer experiences in Discord Activiti..."
  },
  {
    "path": "developers/activities/development-guides/networking.mdx",
    "chars": 4985,
    "preview": "---\ntitle: Networking\ndescription: Learn networking patterns and best practices for Discord Activities.\n---\n\n## Activity..."
  },
  {
    "path": "developers/activities/development-guides/production-readiness.mdx",
    "chars": 2623,
    "preview": "---\ntitle: Production Readiness\ndescription: Prepare your Discord Activity for production deployment.\n---\n\n## Cache Bust..."
  },
  {
    "path": "developers/activities/development-guides/user-actions.mdx",
    "chars": 10229,
    "preview": "---\ntitle: User Actions\ndescription: Implement user interactions and actions in Discord Activities.\n---\n\n## Open Externa..."
  },
  {
    "path": "developers/activities/development-guides.mdx",
    "chars": 8157,
    "preview": "---\ntitle: Activity Development Guides Index\nsidebarTitle: Guide Index\ndescription: Development guides for building Disc..."
  },
  {
    "path": "developers/activities/how-activities-work.mdx",
    "chars": 5887,
    "preview": "---\ntitle: How Activities Work\ndescription: Understand the technical architecture and lifecycle of Discord Activities.\n-..."
  },
  {
    "path": "developers/activities/overview.mdx",
    "chars": 4560,
    "preview": "---\ntitle: Activities Overview\nsidebarTitle: Overview\ndescription: Learn about Discord Activities - multiplayer games an..."
  },
  {
    "path": "developers/bots/overview.mdx",
    "chars": 3135,
    "preview": "---\ntitle: Discord Bots & Companion Apps\nsidebarTitle: Overview\ndescription: Start building bots and companion apps for..."
  },
  {
    "path": "developers/change-log.mdx",
    "chars": 319341,
    "preview": "---\ntitle: \"Change Log\"\ndescription: \"Discover the latest updates, new features, and bug fixes on the Discord Developer..."
  },
  {
    "path": "developers/communities/guides/community-invites.mdx",
    "chars": 3815,
    "preview": "---\ntitle: Community Invites\nsidebarTitle: Community Invites\ndescription: Give members roles and control who can join yo..."
  },
  {
    "path": "developers/components/overview.mdx",
    "chars": 2264,
    "preview": "---\ntitle: Components Overview\nsidebarTitle: Components Overview\nmode: wide\ndescription: Learn about Discord's interacti..."
  },
  {
    "path": "developers/components/reference.mdx",
    "chars": 144364,
    "preview": "---\ntitle: Component Reference\n---\n\nimport {ManualAnchor} from '/snippets/manualanchor.jsx'\n\nThis document serves as a c..."
  },
  {
    "path": "developers/components/using-message-components.mdx",
    "chars": 4380,
    "preview": "---\ntitle: Using Message Components\nsidebarTitle: Using Message Components\ndescription: Learn how to send interactive me..."
  },
  {
    "path": "developers/components/using-modal-components.mdx",
    "chars": 2901,
    "preview": "---\ntitle: Using Modal Components\nsidebarTitle: Using Modal Components\nmode: wide\ndescription: Guide to creating and dis..."
  },
  {
    "path": "developers/developer-tools/community-resources.mdx",
    "chars": 7435,
    "preview": "---\ntitle: Community Resources\ndescription: Discover community-built libraries, tools, and resources for Discord develop..."
  },
  {
    "path": "developers/developer-tools/embedded-app-sdk.mdx",
    "chars": 66495,
    "preview": "---\ntitle: Embedded App SDK Reference\nsidebarTitle: Embedded App SDK Reference\n---\n\nimport {Monospace} from '/snippets/m..."
  },
  {
    "path": "developers/developer-tools/game-sdk.mdx",
    "chars": 62283,
    "preview": "---\ntitle: Game SDK\ntag: \"LEGACY\"\ndescription: Legacy Game SDK documentation for integrating games with Discord.\nnoindex..."
  },
  {
    "path": "developers/discord-social-sdk/core-concepts/communication-features.mdx",
    "chars": 26820,
    "preview": "---\ntitle: Communication Features\ndescription: \"Learn about Discord Social SDK's communication features including direct..."
  },
  {
    "path": "developers/discord-social-sdk/core-concepts/core-features.mdx",
    "chars": 6992,
    "preview": "---\ntitle: Core Features\ndescription: Overview of the Discord Social SDK's core features including user identity and rel..."
  },
  {
    "path": "developers/discord-social-sdk/core-concepts/integration-overview.mdx",
    "chars": 3425,
    "preview": "---\ntitle: Integration Overview\ndescription: High-level overview of integrating the Discord Social SDK into your applica..."
  },
  {
    "path": "developers/discord-social-sdk/core-concepts/mobile.mdx",
    "chars": 10230,
    "preview": "---\ntitle: Discord Social SDK on Mobile\nsidebarTitle: Mobile Development\ndescription: Add the Discord Social SDK to your..."
  },
  {
    "path": "developers/discord-social-sdk/core-concepts/oauth2-scopes.mdx",
    "chars": 5721,
    "preview": "---\ntitle: OAuth2 Scopes for the Social SDK\nsidebarTitle: OAuth2 Scopes\ndescription: Learn about OAuth2 scopes required..."
  },
  {
    "path": "developers/discord-social-sdk/core-concepts/platform-compatibility.mdx",
    "chars": 5282,
    "preview": "---\ntitle: Platform Compatibility\ndescription: Learn about Discord Social SDK platform support and compatibility.\n---\nim..."
  },
  {
    "path": "developers/discord-social-sdk/core-concepts/release-cadence-and-support.mdx",
    "chars": 4918,
    "preview": "---\ntitle: Release Cadence & Support\ndescription: Discord Social SDK release cadence, supported version window, and end-..."
  },
  {
    "path": "developers/discord-social-sdk/core-concepts.mdx",
    "chars": 2999,
    "preview": "---\ntitle: Social SDK Core Concepts\nsidebarTitle: Overview\ndescription: Overview of the Discord Social SDK's core concep..."
  },
  {
    "path": "developers/discord-social-sdk/design-guidelines/branding-guidelines.mdx",
    "chars": 1559,
    "preview": "---\ntitle: Branding Guidelines\ndescription: Official branding guidelines for using Discord's brand assets in your integr..."
  },
  {
    "path": "developers/discord-social-sdk/design-guidelines/chat-history.mdx",
    "chars": 1383,
    "preview": "---\ntitle: Chat History Design Guidelines\nsidebarTitle: Designing for Chat History\ndescription: Design guidelines for di..."
  },
  {
    "path": "developers/discord-social-sdk/design-guidelines/connection-points.mdx",
    "chars": 1921,
    "preview": "---\ntitle: Connection Points\nsidebarTitle: Designing Connection Points\ndescription: Design guidelines for creating effec..."
  },
  {
    "path": "developers/discord-social-sdk/design-guidelines/consoles.mdx",
    "chars": 3068,
    "preview": "---\ntitle: Console Design Guidelines\nsidebarTitle: Designing for Consoles\ndescription: Design guidelines for implementin..."
  },
  {
    "path": "developers/discord-social-sdk/design-guidelines/direct-messages.mdx",
    "chars": 1477,
    "preview": "---\ntitle: Direct Messages Design Guidelines\nsidebarTitle: Designing for Direct Messages\ndescription: Design guidelines..."
  },
  {
    "path": "developers/discord-social-sdk/design-guidelines/game-friends.mdx",
    "chars": 3607,
    "preview": "---\ntitle: Game Friends Design Guidelines\nsidebarTitle: Designing for Game Friends\ndescription: Design guidelines for di..."
  },
  {
    "path": "developers/discord-social-sdk/design-guidelines/linked-channels.mdx",
    "chars": 3864,
    "preview": "---\ntitle: Linked Channels Design Guidelines\nsidebarTitle: Designing for Linked Channels\ndescription: Design guidelines..."
  },
  {
    "path": "developers/discord-social-sdk/design-guidelines/principles.mdx",
    "chars": 1802,
    "preview": "---\ntitle: Principles\ndescription: Core design principles for creating effective Discord Social SDK integrations.\n---\n\n<..."
  },
  {
    "path": "developers/discord-social-sdk/design-guidelines/provisional-accounts.mdx",
    "chars": 2565,
    "preview": "---\ntitle: Provisional Accounts Design Guidelines   \nsidebarTitle: Designing for Provisional Accounts\ndescription: Desig..."
  },
  {
    "path": "developers/discord-social-sdk/design-guidelines/signing-in.mdx",
    "chars": 3330,
    "preview": "---\ntitle: Designing for Account Linking\nsidebarTitle: Designing for Account Linking\ndescription: Design guidelines for..."
  },
  {
    "path": "developers/discord-social-sdk/design-guidelines/social-settings.mdx",
    "chars": 1856,
    "preview": "---\ntitle: Social Settings Design Guidelines\nsidebarTitle: Designing Social Settings\ndescription: Design guidelines for..."
  },
  {
    "path": "developers/discord-social-sdk/design-guidelines/status-rich-presence.mdx",
    "chars": 2435,
    "preview": "---\ntitle: User Status & Rich Presence Design Guidelines\nsidebarTitle: Designing for User Status\ndescription: Design gui..."
  },
  {
    "path": "developers/discord-social-sdk/design-guidelines/unified-friends-list.mdx",
    "chars": 5591,
    "preview": "---\ntitle: Unified Friends List Design Guidelines\nsidebarTitle: Designing a Unified Friends List\ndescription: Design gui..."
  },
  {
    "path": "developers/discord-social-sdk/design-guidelines.mdx",
    "chars": 5009,
    "preview": "---\ntitle: Discord Social SDK Design Guidelines\nsidebarTitle: Glossary\ndescription: Definitions and explanations of key..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/account-linking-from-discord.mdx",
    "chars": 13179,
    "preview": "---\ntitle: Account Linking from Discord\ndescription: Adopt the new account linking APIs to allow Discord to show your pl..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/account-linking-on-consoles.mdx",
    "chars": 13189,
    "preview": "---\ntitle: Account Linking on Consoles\ndescription: Implement Discord account linking on gaming consoles.\n---\nimport Pub..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/account-linking-on-mobile.mdx",
    "chars": 23762,
    "preview": "---\ntitle: Account Linking on Mobile\ndescription: Implement OAuth2 authentication for iOS and Android with deep linking..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/account-linking-on-web.mdx",
    "chars": 11715,
    "preview": "---\ntitle: Account Linking on Web\ndescription: Build the OAuth2 authorization flow to link players' Discord accounts to..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/account-linking-with-discord.mdx",
    "chars": 26763,
    "preview": "---\ntitle: Account Linking from Your Game\ndescription: Implement account linking to connect user accounts between your a..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/creating-a-unified-friends-list.mdx",
    "chars": 20168,
    "preview": "---\ntitle: Creating a Unified Friends List\ndescription: Build a unified friends list that combines Discord relationships..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/linked-channels.mdx",
    "chars": 17127,
    "preview": "---\ntitle: Linked Channels\ndescription: Connect Discord channels with your application for seamless communication.\n---\ni..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/managing-game-invites.mdx",
    "chars": 26501,
    "preview": "---\ntitle: Managing Game Invites\ndescription: Create and manage game invitations through Discord to bring friends into y..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/managing-lobbies.mdx",
    "chars": 18499,
    "preview": "---\ntitle: Creating and Managing Lobbies\nsidebarTitle: Managing Lobbies\ndescription: Create and manage game lobbies with..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/managing-relationships.mdx",
    "chars": 16311,
    "preview": "---\ntitle: Managing Relationships in Your Game\nsidebarTitle: Managing Relationships\ndescription: Manage Discord user rel..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/managing-voice-chat.mdx",
    "chars": 22127,
    "preview": "---\ntitle: Managing Voice Chat\ndescription: Integrate Discord voice chat features into your application.\n---\nimport Rate..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/provisional-accounts/bot-token-endpoint.mdx",
    "chars": 6958,
    "preview": "---\ntitle: Bot Token Endpoint\ndescription: Create provisional accounts server-side from your game's own unique user IDs..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/provisional-accounts/external-credentials-exchange.mdx",
    "chars": 4767,
    "preview": "---\ntitle: External Credentials Exchange\ndescription: Exchange an external provider token (OIDC, Steam, EOS, and more) s..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/provisional-accounts/identity-providers.mdx",
    "chars": 10442,
    "preview": "---\ntitle: Configuring Identity Providers\nsidebarTitle: Identity Providers\ndescription: Configure OIDC, Steam, EOS, and..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/provisional-accounts/managing-accounts.mdx",
    "chars": 8336,
    "preview": "---\ntitle: Managing Provisional Accounts\ndescription: Refresh provisional account access tokens and set display names.\n-..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/provisional-accounts/merging-accounts.mdx",
    "chars": 27134,
    "preview": "---\ntitle: Merging Accounts\ndescription: Convert a provisional account into a full Discord account, migrating the player..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/provisional-accounts/overview.mdx",
    "chars": 9524,
    "preview": "---\ntitle: Provisional Accounts\nsidebarTitle: Overview\ndescription: Implement provisional Discord accounts for users who..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/provisional-accounts/public-client.mdx",
    "chars": 5184,
    "preview": "---\ntitle: Public Client Integration\ndescription: Create provisional accounts directly from the client when you don't ha..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/provisional-accounts/unmerging-accounts.mdx",
    "chars": 15318,
    "preview": "---\ntitle: Unmerging Accounts\ndescription: Sever the link between a Discord account and a provisional account, and under..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/publisher-level-account-linking.mdx",
    "chars": 22652,
    "preview": "---\ntitle: Publisher Level Account Linking\n---\n\nimport SupportCallout from '/snippets/discord-social-sdk/callouts/suppor..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/sending-direct-messages.mdx",
    "chars": 14649,
    "preview": "---\ntitle: Sending Direct Messages\ndescription: Send direct messages to Discord users from your application.\n---\nimport..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/setting-rich-presence.mdx",
    "chars": 20358,
    "preview": "---\ntitle: Setting Rich Presence\ndescription: Update Discord Rich Presence from your application to display activity inf..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides/unlinking-accounts.mdx",
    "chars": 5217,
    "preview": "---\ntitle: Unlinking Accounts\ndescription: Best practices for unlinking a user's Discord account from your game, includi..."
  },
  {
    "path": "developers/discord-social-sdk/development-guides.mdx",
    "chars": 4541,
    "preview": "---\ntitle: Discord Social SDK Development Guides Glossary\nsidebarTitle: Glossary\ndescription: Definitions and explanatio..."
  },
  {
    "path": "developers/discord-social-sdk/getting-started/partials/dylib-mac-error.mdx",
    "chars": 820,
    "preview": "<Accordion title=\"Mac libdiscord_partner_sdk.dylib Not Opened\" icon=\"warning\">\nOn Mac you may get the error \"libdiscord_..."
  },
  {
    "path": "developers/discord-social-sdk/getting-started/partials/getting-started.mdx",
    "chars": 2772,
    "preview": "## Step 1: Create a Discord Developer Team\n\nBefore you start, you'll need to create a developer team on the Discord Deve..."
  },
  {
    "path": "developers/discord-social-sdk/getting-started/using-c++.mdx",
    "chars": 36135,
    "preview": "---\nsidebarTitle: Using Standalone C++\ntitle: Getting Started with C++ and the Discord Social SDK\ndescription: Get start..."
  },
  {
    "path": "developers/discord-social-sdk/getting-started/using-unity.mdx",
    "chars": 32448,
    "preview": "---\ntitle: Getting Started with Unity and the Discord Social SDK\nsidebarTitle: Using Unity\ndescription: Integrate the Di..."
  },
  {
    "path": "developers/discord-social-sdk/getting-started/using-unreal-engine.mdx",
    "chars": 30334,
    "preview": "---\ntitle: Getting Started with Unreal Engine and the Discord Social SDK\nsidebarTitle: Using Unreal Engine\ndescription:..."
  },
  {
    "path": "developers/discord-social-sdk/getting-started.mdx",
    "chars": 2140,
    "preview": "---\ntitle: Getting Started with the Discord Social SDK\nsidebarTitle: Overview\ndescription: Quick start guide for integra..."
  },
  {
    "path": "developers/discord-social-sdk/how-to/debug-log.mdx",
    "chars": 6404,
    "preview": "---\ntitle: Debug & Log\ndescription: Learn how to enable and use debug logging in the Discord Social SDK.\n---\nimport Publ..."
  },
  {
    "path": "developers/discord-social-sdk/how-to/handle-rate-limits.mdx",
    "chars": 4630,
    "preview": "---\ntitle: Handle Rate Limits\ndescription: Detect and handle rate limit errors in the Discord Social SDK using ClientRes..."
  },
  {
    "path": "developers/discord-social-sdk/how-to/handle-special-characters-display-names.mdx",
    "chars": 3072,
    "preview": "---\ntitle: How To Handle Special Characters in Display Names\nsidebarTitle: Handle Special Characters in Display Names\nde..."
  },
  {
    "path": "developers/discord-social-sdk/how-to/integrate-moderation.mdx",
    "chars": 19799,
    "preview": "---\ntitle: Integrate Moderation\ndescription: Implement moderation features and safety controls in your application.\n---..."
  },
  {
    "path": "developers/discord-social-sdk/how-to/market-your-integration.mdx",
    "chars": 14358,
    "preview": "---\ntitle: Market Your Integration\ndescription: Best practices for marketing and promoting your Discord Social SDK integ..."
  },
  {
    "path": "developers/discord-social-sdk/how-to/use-with-discord-apis.mdx",
    "chars": 4373,
    "preview": "---\ntitle: Use with Discord APIs\ndescription: Combine Discord Social SDK with Discord's REST APIs for enhanced functiona..."
  },
  {
    "path": "developers/discord-social-sdk/how-to/voice-muting-for-blocked-players.mdx",
    "chars": 12991,
    "preview": "---\ntitle: Voice Muting Based on Player Blocks\ndescription: |\n    Implement bi-directional voice muting for blocked play..."
  },
  {
    "path": "developers/discord-social-sdk/how-to.mdx",
    "chars": 2569,
    "preview": "---\ntitle: How To Guides\nsidebarTitle: Overview\ndescription: How-to guides for integrating Discord Social SDK features i..."
  },
  {
    "path": "developers/discord-social-sdk/overview.mdx",
    "chars": 3270,
    "preview": "---\ntitle: Integrating the Discord Social SDK\nsidebarTitle: Overview\ndescription: Learn how to integrate Discord-powered..."
  },
  {
    "path": "developers/discord-social-sdk/partials/callouts/console-access.mdx",
    "chars": 272,
    "preview": "<Info>\nTo use the Discord Social SDK in your console games, you will need to request middleware approval and be an appro..."
  },
  {
    "path": "developers/discord-social-sdk/partials/callouts/oauth-comms-scopes.mdx",
    "chars": 466,
    "preview": "<Warning>\nTo utilize this communication feature, you must enable [`Client::GetDefaultCommunicationScopes`] in your OAuth..."
  },
  {
    "path": "developers/discord-social-sdk/partials/callouts/public-client.mdx",
    "chars": 227,
    "preview": "<Warning>\nThis method requires enabling **Public Client** for your app. Most games will not want to ship with this enabl..."
  },
  {
    "path": "developers/discord-social-sdk/partials/callouts/rate-limit.mdx",
    "chars": 346,
    "preview": "<Warning>\nThis feature is currently available with rate limits.\nTo increase the rate limits for your game, please follow..."
  },
  {
    "path": "developers/discord-social-sdk/partials/callouts/sony.mdx",
    "chars": 444,
    "preview": "<Warning>\n<u>Exception: Prohibited Off-Platform Interactions by Sony</u><br/>\nFor integrations experienced on Sony Platf..."
  },
  {
    "path": "developers/discord-social-sdk/partials/callouts/support.mdx",
    "chars": 297,
    "preview": "Need help? Join the [Discord Developers Server](https://discord.gg/discord-developers) and share questions in the `#soci..."
  },
  {
    "path": "developers/discord-social-sdk/social-sdk-reference.mdx",
    "chars": 163,
    "preview": "---\ntitle: Social SDK Reference\nurl: https://discord.com/developers/docs/social-sdk/index.html\ndescription: Complete API..."
  },
  {
    "path": "developers/discovery/best-practices.mdx",
    "chars": 7062,
    "preview": "---\ntitle: Discovery Best Practices\nsidebarTitle: Best Practices\ndescription: Tips and best practices for optimizing you..."
  },
  {
    "path": "developers/discovery/enabling-discovery.mdx",
    "chars": 3422,
    "preview": "---\ntitle: Enabling Discovery\ndescription: Step-by-step guide to verify your app and enable discovery.\n---\n\nimport {Book..."
  },
  {
    "path": "developers/discovery/overview.mdx",
    "chars": 3581,
    "preview": "---\ntitle: Discovery on Discord\nsidebarTitle: App Directory\ndescription: Learn how to make your Discord app discoverable..."
  },
  {
    "path": "developers/events/gateway-events.mdx",
    "chars": 135111,
    "preview": "---\ntitle: Gateway Events\ndescription: Complete reference for all Gateway events.\n---\n\nimport {ManualAnchor} from '/snip..."
  },
  {
    "path": "developers/events/gateway.mdx",
    "chars": 52758,
    "preview": "---\ntitle: Gateway\nsidebarTitle: Using Gateway\ndescription: Learn how to establish and maintain Gateway API connections..."
  },
  {
    "path": "developers/events/overview.mdx",
    "chars": 3982,
    "preview": "---\ntitle: Overview of Events\nsidebarTitle: Overview\ndescription: Learn about the different ways apps can receive events..."
  },
  {
    "path": "developers/events/webhook-events.mdx",
    "chars": 32320,
    "preview": "---\ntitle: Webhook Events\ndescription: Learn how to receive Discord events over HTTP using webhooks.\n---\n\nimport {Manual..."
  },
  {
    "path": "developers/game-development/how-to-add-proximity-voice-chat-to-your-game.mdx",
    "chars": 18622,
    "preview": "---\ntitle: How Do I Add Proximity Voice Chat to My Game?\nsidebarTitle: Add Proximity Voice Chat to Your Game\nkeywords: [..."
  },
  {
    "path": "developers/game-development/how-to-create-a-community-for-your-game.mdx",
    "chars": 35970,
    "preview": "---\ntitle: How Do I Create a Community For My Game?\nsidebarTitle: Create a Community For Your Game\n---\n\nimport {ImageCar..."
  },
  {
    "path": "developers/game-development/how-to-get-your-game-seen.mdx",
    "chars": 30670,
    "preview": "---\ntitle: How Do I Get My Game Seen?\nsidebarTitle: Get Your Game Seen\n---\n\nimport {ImageCard} from '/snippets/imagecard..."
  },
  {
    "path": "developers/game-development/how-to-grow-your-game.mdx",
    "chars": 9980,
    "preview": "---\ntitle: How Can I Grow My Game?\nsidebarTitle: Grow Your Game\n---\n\nimport {ImageCard} from '/snippets/imagecard.jsx'\ni..."
  },
  {
    "path": "developers/game-development/how-to-keep-your-players-engaged.mdx",
    "chars": 20218,
    "preview": "---\ntitle: How Do I Keep My Players Engaged?\nsidebarTitle: Keep Your Players Engaged\n---\n\nimport {ImageCard} from '/snip..."
  },
  {
    "path": "developers/gateway/getting-started-with-privileged-intent-review.mdx",
    "chars": 13547,
    "preview": "---\ntitle: Getting Started with Privileged Intent Review\ndescription: Guide to understanding the privileged intent revie..."
  },
  {
    "path": "developers/gateway/you-might-not-need-a-privileged-intent.mdx",
    "chars": 10555,
    "preview": "---\ntitle: You Might Not Need a Privileged Intent\ndescription: Guide to understanding privileged intents and their alter..."
  },
  {
    "path": "developers/guides/activities.mdx",
    "chars": 1456,
    "preview": "---\ntitle: \"Discord Activity Development Guides\"\nsidebarTitle: \"Discord Activities\"\ndescription: \"Guides for developing..."
  },
  {
    "path": "developers/guides/bots.mdx",
    "chars": 2808,
    "preview": "---\ntitle: \"Discord Bot Development Guides\"\nsidebarTitle: \"Bot Development\"\ndescription: \"Guides for developing bots on..."
  },
  {
    "path": "developers/guides/communities.mdx",
    "chars": 990,
    "preview": "---\ntitle: \"Community Management Guides\"\nsidebarTitle: \"Community Management\"\ndescription: \"Guides for managing your Dis..."
  },
  {
    "path": "developers/guides/game-development.mdx",
    "chars": 2114,
    "preview": "---\ntitle: \"Game Development Guides\"\nsidebarTitle: \"Game Development\"\ndescription: \"Guides for creating games using Disc..."
  },
  {
    "path": "developers/guides/platform.mdx",
    "chars": 733,
    "preview": "---\ntitle: \"Platform Feature Guides\"\nsidebarTitle: \"Platform Features\"\ndescription: \"Guides for using Discord's features..."
  },
  {
    "path": "developers/guides/social-sdk.mdx",
    "chars": 4336,
    "preview": "---\ntitle: \"Discord Social SDK Guides\"\nsidebarTitle: \"Social SDK\"\ndescription: \"Development guides for integrating the D..."
  },
  {
    "path": "developers/guides.mdx",
    "chars": 1792,
    "preview": "---\ntitle: \"Discord Development Guide Library\"\nsidebarTitle: \"Guide Library\"\ndescription: \"Guides to help you get starte..."
  },
  {
    "path": "developers/interactions/application-commands.mdx",
    "chars": 107749,
    "preview": "---\ntitle: Application Commands\ndescription: Complete guide to creating slash commands, user commands, and message comma..."
  },
  {
    "path": "developers/interactions/overview.mdx",
    "chars": 11566,
    "preview": "---\ntitle: Interactions Overview\nsidebarTitle: Interactions Overview\ndescription: Learn about Discord's interactive feat..."
  },
  {
    "path": "developers/interactions/receiving-and-responding.mdx",
    "chars": 59609,
    "preview": "---\ntitle: Receiving and Responding to Interactions\nsidebarTitle: Receiving and Responding\n---\n\nimport {ManualAnchor} fr..."
  },
  {
    "path": "developers/intro.mdx",
    "chars": 2877,
    "preview": "---\ntitle: \"Discord Developer Platform\"\nsidebarTitle: \"Introduction\"\ndescription: Build bots and integrations on Discord..."
  },
  {
    "path": "developers/link-previews/component-embeds.mdx",
    "chars": 10496,
    "preview": "---\ntitle: Component Embeds\nsidebarTitle: Component Embeds\ndescription: Build a custom link preview for your website usi..."
  },
  {
    "path": "developers/link-previews/overview.mdx",
    "chars": 16500,
    "preview": "---\ntitle: Link Previews\nsidebarTitle: Overview\ndescription: Control how links to your website look when they are shared..."
  },
  {
    "path": "developers/monetization/enabling-monetization.mdx",
    "chars": 5570,
    "preview": "---\ntitle: Enabling Monetization\ndescription: Step-by-step guide to meet eligibility requirements and enable monetizatio..."
  },
  {
    "path": "developers/monetization/implementing-app-subscriptions.mdx",
    "chars": 18692,
    "preview": "---\ntitle: Implementing App Subscriptions\ndescription: Learn how to implement recurring user and guild subscriptions for..."
  },
  {
    "path": "developers/monetization/implementing-iap-for-activities.mdx",
    "chars": 11561,
    "preview": "---\ntitle: Implementing In-App Purchases for Activities\nsidebarTitle: Implementing IAP for Activities\ndescription: Step-..."
  },
  {
    "path": "developers/monetization/implementing-one-time-purchases.mdx",
    "chars": 8468,
    "preview": "---\ntitle: Implementing One-Time Purchases\ndescription: Guide to implementing durable and consumable one-time purchases...."
  },
  {
    "path": "developers/monetization/managing-skus.mdx",
    "chars": 10584,
    "preview": "---\ntitle: Managing SKUs\ndescription: Learn how to create and manage SKUs that represent your app's premium offerings.\n-..."
  },
  {
    "path": "developers/monetization/overview.mdx",
    "chars": 2450,
    "preview": "---\ntitle: Monetizing Your Discord App\nsidebarTitle: App Monetization\ndescription: Learn how to add premium features to..."
  },
  {
    "path": "developers/platform/account-linking.mdx",
    "chars": 10710,
    "preview": "---\ntitle: Account Linking\nsidebarTitle: Account Linking\ndescription: Connect a player's Discord account to their in-gam..."
  },
  {
    "path": "developers/platform/activities.mdx",
    "chars": 1884,
    "preview": "---\ntitle: Activities\nsidebarTitle: Activities\ndescription: Build multiplayer games and social experiences that run dire..."
  },
  {
    "path": "developers/platform/app-monetization.mdx",
    "chars": 1987,
    "preview": "---\ntitle: Premium Apps & Activities\nsidebarTitle: Premium Apps & Activities\ndescription: Add subscriptions and one-time..."
  },
  {
    "path": "developers/platform/bots.mdx",
    "chars": 2010,
    "preview": "---\ntitle: Bots & Companion Apps\nsidebarTitle: Discord Bots\ndescription: Build bots and companion apps that connect to D..."
  },
  {
    "path": "developers/platform/claim-your-game.mdx",
    "chars": 7550,
    "preview": "---\ntitle: Claim Your Game\ndescription: Learn how to claim your game on Discord to unlock a verified checkmark and take..."
  },
  {
    "path": "developers/platform/community-servers.mdx",
    "chars": 2397,
    "preview": "---\ntitle: Community Servers\nsidebarTitle: Community Servers\ndescription: Build and grow a player community around your..."
  },
  {
    "path": "developers/platform/components.mdx",
    "chars": 2329,
    "preview": "---\ntitle: Components & Modals\nsidebarTitle: Components & Modals\ndescription: Add interactive buttons, menus, layout ele..."
  },
  {
    "path": "developers/platform/discovery.mdx",
    "chars": 2104,
    "preview": "---\ntitle: App  Discovery\nsidebarTitle: App Discovery\ndescription: Make your Discord app discoverable through the App Di..."
  },
  {
    "path": "developers/platform/game-profiles.mdx",
    "chars": 2324,
    "preview": "---\ntitle: Game Profiles\ndescription: Learn how Discord surfaces game information to users and where your game's profile..."
  },
  {
    "path": "developers/platform/interactions.mdx",
    "chars": 3501,
    "preview": "---\ntitle: Interactions & Commands\nsidebarTitle: Interactions & Commands\ndescription: Build interactive slash commands,..."
  },
  {
    "path": "developers/platform/oauth2-and-permissions.mdx",
    "chars": 3446,
    "preview": "---\ntitle: \"OAuth2 and Permissions\"\nsidebarTitle: \"OAuth2 & Permissions\"\ndescription: How OAuth2, scopes, and permission..."
  },
  {
    "path": "developers/platform/rich-presence.mdx",
    "chars": 3882,
    "preview": "---\ntitle: Rich Presence\nsidebarTitle: Rich Presence\ndescription: Display real-time game activity on Discord user profil..."
  },
  {
    "path": "developers/platform/server-and-channel-management.mdx",
    "chars": 2791,
    "preview": "---\ntitle: \"Server and Channel Management\"\nsidebarTitle: \"Server & Channel Management\"\ndescription: What Discord apps ca..."
  },
  {
    "path": "developers/platform/social-layer.mdx",
    "chars": 3905,
    "preview": "---\ntitle: Social Layer for Games\nsidebarTitle: Social Layer\ndescription: Add Discord-powered social features directly i..."
  },
  {
    "path": "developers/platform/webhooks.mdx",
    "chars": 2519,
    "preview": "---\ntitle: \"Webhooks\"\nsidebarTitle: \"Webhooks\"\ndescription: Send messages into Discord channels or receive event notific..."
  },
  {
    "path": "developers/policies/developer-policy.mdx",
    "chars": 126,
    "preview": "---\ntitle: Developer Policy\nurl: https://support-dev.discord.com/hc/en-us/articles/8563934450327-Discord-Developer-Polic..."
  },
  {
    "path": "developers/policies/developer-terms-of-service.mdx",
    "chars": 146,
    "preview": "---\ntitle: Developer Terms of Service\nurl: https://support-dev.discord.com/hc/en-us/articles/8562894815383-Discord-Devel..."
  },
  {
    "path": "developers/quick-start/getting-started.mdx",
    "chars": 34022,
    "preview": "---\ntitle: Building your first Discord Bot\nsidebarTitle: Build Your First Bot\ndescription: Step-by-step tutorial for bui..."
  },
  {
    "path": "developers/quick-start/overview-of-apps.mdx",
    "chars": 5690,
    "preview": "---\ntitle: Overview of Discord Apps\ndescription: Build Discord apps to customize, extend, and enhance Discord for millio..."
  },
  {
    "path": "developers/reference.mdx",
    "chars": 40028,
    "preview": "---\ntitle: API Reference\ndescription: \"The Discord API is a REST API that allows you to interact with Discord data from..."
  },
  {
    "path": "developers/resources/application-identity-profile.mdx",
    "chars": 25710,
    "preview": "---\ntitle: \"Application Identity Profile Resource\"\nsidebarTitle: \"Application Identity Profile Resource\"\ndescription: Re..."
  },
  {
    "path": "developers/resources/application-role-connection-metadata.mdx",
    "chars": 7049,
    "preview": "---\ntitle: Application Role Connection Metadata\ndescription: Complete reference for application role connection metadata..."
  },
  {
    "path": "developers/resources/application.mdx",
    "chars": 41946,
    "preview": "---\ntitle: Application Resource\nsidebarTitle: Application\ndescription: Reference for Discord application objects and man..."
  },
  {
    "path": "developers/resources/audit-log.mdx",
    "chars": 42446,
    "preview": "---\ntitle: Audit Logs Resource\nsidebarTitle: Audit Log\ndescription: Reference for Discord audit log objects and endpoint..."
  },
  {
    "path": "developers/resources/auto-moderation.mdx",
    "chars": 25001,
    "preview": "---\ntitle: Auto Moderation\ndescription: Reference for Discord's Auto Moderation system and endpoints.\n---\n\nimport {Manua..."
  },
  {
    "path": "developers/resources/channel.mdx",
    "chars": 88221,
    "preview": "---\ntitle: Channels Resource\nsidebarTitle: Channel\n---\n\nimport {ManualAnchor} from '/snippets/manualanchor.jsx'\nimport {..."
  },
  {
    "path": "developers/resources/emoji.mdx",
    "chars": 12235,
    "preview": "---\ntitle: Emoji Resource\nsidebarTitle: Emoji\ndescription: Reference for Discord emoji objects and management endpoints...."
  },
  {
    "path": "developers/resources/entitlement.mdx",
    "chars": 9555,
    "preview": "---\ntitle: Entitlement Resource\nsidebarTitle: Entitlement\ndescription: Reference for Discord entitlement objects that re..."
  },
  {
    "path": "developers/resources/guild-scheduled-event.mdx",
    "chars": 38127,
    "preview": "---\ntitle: Guild Scheduled Event\nsidebarTitle: Guild Scheduled Event\ndescription: Reference for Discord scheduled event..."
  },
  {
    "path": "developers/resources/guild-template.mdx",
    "chars": 7406,
    "preview": "---\ntitle: Guild Template Resource\nsidebarTitle: Guild Template\ndescription: Reference for Discord Guild Template object..."
  },
  {
    "path": "developers/resources/guild.mdx",
    "chars": 131855,
    "preview": "---\ntitle: Guild Resource\nsidebarTitle: Guild\n---\n\nimport {ManualAnchor} from '/snippets/manualanchor.jsx'\nimport {Route..."
  },
  {
    "path": "developers/resources/invite.mdx",
    "chars": 15143,
    "preview": "---\ntitle: Invite Resource\nsidebarTitle: Invite\n---\n\nimport {ManualAnchor} from '/snippets/manualanchor.jsx'\nimport {Rou..."
  },
  {
    "path": "developers/resources/lobby.mdx",
    "chars": 31568,
    "preview": "---\ntitle: Lobby Resource\nsidebarTitle: Lobby\ndescription: Reference for Discord lobby objects used for matchmaking.\n---..."
  },
  {
    "path": "developers/resources/message.mdx",
    "chars": 130679,
    "preview": "---\ntitle: Message Resource\nsidebarTitle: Message\ndescription: Reference for Discord message objects and management endp..."
  },
  {
    "path": "developers/resources/poll.mdx",
    "chars": 10835,
    "preview": "---\ntitle: Poll Resource\nsidebarTitle: Poll\ndescription: Reference for Discord poll objects and management endpoints.\n--..."
  },
  {
    "path": "developers/resources/sku.mdx",
    "chars": 5496,
    "preview": "---\ntitle: SKU Resource\nsidebarTitle: SKU\ndescription: Reference for Discord SKU objects that represent premium app offe..."
  },
  {
    "path": "developers/resources/soundboard.mdx",
    "chars": 9811,
    "preview": "---\ntitle: Soundboard Resource\nsidebarTitle: Soundboard\ndescription: Reference for Discord soundboard objects and manage..."
  },
  {
    "path": "developers/resources/stage-instance.mdx",
    "chars": 7696,
    "preview": "---\ntitle: Stage Instance Resource\nsidebarTitle: Stage Instance\ndescription: Reference for Discord stage instance object..."
  },
  {
    "path": "developers/resources/sticker.mdx",
    "chars": 12386,
    "preview": "---\ntitle: Sticker Resource\nsidebarTitle: Sticker\ndescription: Reference for Discord sticker objects and management endp..."
  },
  {
    "path": "developers/resources/subscription.mdx",
    "chars": 6564,
    "preview": "---\ntitle: Subscription Resource\nsidebarTitle: Subscription\ndescription: Reference for Discord subscription objects that..."
  },
  {
    "path": "developers/resources/user.mdx",
    "chars": 30357,
    "preview": "---\ntitle: User Resource\nsidebarTitle: User\ndescription: Reference for Discord user objects and management endpoints.\n--..."
  },
  {
    "path": "developers/resources/voice.mdx",
    "chars": 7656,
    "preview": "---\ntitle: Voice Resource\nsidebarTitle: Voice\ndescription: Reference for Discord voice objects and connection endpoints...."
  },
  {
    "path": "developers/resources/webhook.mdx",
    "chars": 33758,
    "preview": "---\ntitle: Webhook Resource\nsidebarTitle: Webhook\ndescription: Reference for Discord webhook objects and management endp..."
  },
  {
    "path": "developers/rich-presence/best-practices.mdx",
    "chars": 4734,
    "preview": "---\ntitle: Best Practices for Rich Presence\nsidebarTitle: Best Practices\ndescription: Best practices and guidelines for..."
  },
  {
    "path": "developers/rich-presence/overview.mdx",
    "chars": 3328,
    "preview": "---\ntitle: Overview of Rich Presence\nsidebarTitle: Overview\ndescription: Learn how to integrate Rich Presence to display..."
  },
  {
    "path": "developers/rich-presence/using-with-the-embedded-app-sdk.mdx",
    "chars": 11816,
    "preview": "---\ntitle: Setting a User's Rich Presence\nsidebarTitle: Setting Rich Presence\n---\n\nWhen developing an [Activity](/develo..."
  },
  {
    "path": "developers/social-commerce/overview.mdx",
    "chars": 3459,
    "preview": "---\ntitle: Social Commerce & Game Shops\nsidebarTitle: Social Commerce\ndescription: Sell in-game items, cosmetics, and bu..."
  },
  {
    "path": "developers/social-layer/game-stats-widgets/best-practices.mdx",
    "chars": 11720,
    "preview": "---\ntitle: \"Best Practices: Game Stats Widgets\"\nsidebarTitle: Widget Best Practices\ndescription: When to sync profile da..."
  },
  {
    "path": "developers/social-layer/game-stats-widgets/overview.mdx",
    "chars": 6625,
    "preview": "---\ntitle: Game Stats Widgets\nsidebarTitle: Overview\ndescription: Display game stats like rank, playtime, and wins on Di..."
  },
  {
    "path": "developers/social-layer/game-stats-widgets/sending-game-data.mdx",
    "chars": 6488,
    "preview": "---\ntitle: \"Sending Game Data\"\nsidebarTitle: Sending Game Data\ndescription: Authorize requests and send player stats to..."
  },
  {
    "path": "developers/social-layer/game-stats-widgets/widget-configuration.mdx",
    "chars": 11485,
    "preview": "---\ntitle: \"Configuring Your Widget\"\nsidebarTitle: Configuring Your Widget\ndescription: Configure your Game Stats Widget..."
  },
  {
    "path": "developers/topics/certified-devices.mdx",
    "chars": 8716,
    "preview": "---\ntitle: Certified Devices\ndescription: Learn about Discord's Certified Device program for hardware integration.\n---..."
  },
  {
    "path": "developers/topics/oauth2.mdx",
    "chars": 44596,
    "preview": "---\ntitle: OAuth2\n---\n\nimport {ManualAnchor} from '/snippets/manualanchor.jsx'\nimport {Route} from '/snippets/route.jsx'..."
  },
  {
    "path": "developers/topics/opcodes-and-status-codes.mdx",
    "chars": 79823,
    "preview": "---\ntitle: Opcodes and Status Codes\n---\n\nimport {ManualAnchor} from '/snippets/manualanchor.jsx'\n\n## Gateway\n\nAll gatewa..."
  },
  {
    "path": "developers/topics/permissions.mdx",
    "chars": 36323,
    "preview": "---\ntitle: Permissions\ndescription: Learn how Discord's permission system works including bitwise operations.\n---\n\nimpor..."
  }
]

// ... and 102 more files (download for full content)

About this extraction

This page contains the full source code of the discord/discord-api-docs GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 302 files (3.5 MB), approximately 946.3k tokens, and a symbol index with 39 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!