# Discord

## Register OAuth2 app

Go to the Discord Developer Portal: <https://discord.com/developers/applications> and create a new Application.

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-de491ce503729b45c191b338eb93260e8dbe67f8%2Fdiscord-1.png?alt=media)

1. Click “New Application”
2. Give it a name, accept their **Terms of Service** and click “Create”
3. Open your new application

## Basic Information

To obtain your OAuth credentials, go to OAuth2 tab:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-a05211011ec870401625a38d2967183d99acebeb%2Fdiscord-2.png?alt=media)

* Client ID: shown on the “Client information” card as “Client ID”
* Client Secret: click “Reset Secret” to generate a secret and copy it

You’ll paste these into the Appmixer Backoffice later.

## OAuth2 & Redirect URL

You must add the redirect/callback URL so Discord can return users to Appmixer after authorization.

* Go to OAuth2 tab
* In “Redirects”, add your Appmixer URL. Example:

  <https://api.YOUR\\_SUBDOMAIN.appmixer.cloud/auth/discord/callback>

Note: Replace YOUR\_SUBDOMAIN with your actual Appmixer subdomain. The path “/auth/discord/callback” follows the same pattern as other Appmixer connectors.

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-5f7bf08f67ec416fddbb0677ec4f3398d829bfa2%2Fdiscord-3.png?alt=media)

## Add a Bot and get the Bot Token

To make the events (sending messages, reacting to events) be from a bot, add one:

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-001a531a127d7c4ab0b2e9218f499efe62735dd8%2Fdiscord-4.png?alt=media)

* Click “Reset Token” to reveal the Bot Token and copy it

Keep the token secure. You’ll paste it in the Backoffice as well.

Check the settings below in **Authorization Flow**, recommended set up is:

* Public Bot: ON
* Requires OAuth2 Code Grant: ON
* Server Members Intent: ON

Rest can be turned off.

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-5cf9a5777334b1388bdf67b2f8bc331bfbfefa6d%2Fdiscord-5.png?alt=media)

## Scopes and Permissions

How you configure scopes:

* Installation → Default Install Settings:
  * User Install: applications.commands
  * Guild Install: applications.commands, bot

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-82b14d61315a34b79b1f5c52154dee8d126a351e%2Fdiscord-6.png?alt=media)

## Backoffice (Appmixer admin)

Copy and paste the values into the Backoffice under the Discord connector configuration (appmixer:discord):

![](https://802996127-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIAGKHlIqVKJe9agnFr14%2Fuploads%2Fgit-blob-6bfa4baab708067906f78a47a7b44c393baf65ee%2Fdiscord-7.png?alt=media)

* clientId → "Client ID" from Discord
* clientSecret → “Client Secret” from Discord
* botToken → “Bot Token”

After saving, return to your flow in Appmixer. Click “Connect account” for the Discord connector, complete the authorization, and you’re ready to use Discord components in your flows.
