> ## Documentation Index
> Fetch the complete documentation index at: https://nango.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Discord Bot

> Integrate your application with the Discord API using a bot token

## 🚀 Quickstart

Connect to Discord with Nango and see data flow in 2 minutes.

**1. Create the integration**

In Nango ([free signup](https://app.nango.dev)), go to [Integrations](https://app.nango.dev/dev/integrations) -> *Configure New Integration* -> *Discord Bot*.

**2. Authorize Discord Bot**

Go to [Connections](https://app.nango.dev/dev/connections) -> *Add Test Connection* -> *Authorize*, then enter your bot token from the Discord Developer Portal. Later, you'll let your users do the same directly from your app.

**3. Call the Discord API**

Make your first request to the Discord API (e.g. get your application info). Replace the placeholders below with your [Environment API key](https://nango.dev/docs/reference/backend/http-api/api-keys.md), [integration ID](https://app.nango.dev/dev/integrations), and [connection ID](https://app.nango.dev/dev/connections):

**cURL**

```bash theme={null}
curl "https://api.nango.dev/proxy/api/v10/applications/@me" \
  -H "Authorization: Bearer <NANGO-API-KEY>" \
  -H "Provider-Config-Key: <INTEGRATION-ID>" \
  -H "Connection-Id: <CONNECTION-ID>"
```

**Node**

Install Nango's backend SDK with `npm i @nangohq/node`. Then run:

```typescript theme={null}
import { Nango } from '@nangohq/node';

const nango = new Nango({ apiKey: '<NANGO-API-KEY>' });

const res = await nango.get({
    endpoint: '/api/v10/applications/@me',
    providerConfigKey: '<INTEGRATION-ID>',
    connectionId: '<CONNECTION-ID>'
});

console.log(res.data);
```

Or fetch credentials with the [Node SDK](https://nango.dev/docs/reference/sdks/node.md#get-a-connection-with-credentials) or [API](https://nango.dev/docs/reference/api/connection/get.md).

✅ You're connected! Check the [Logs](https://app.nango.dev/dev/logs) tab in Nango to inspect requests.

**4. Implement Nango in your app**

Follow our [Auth implementation guide](https://nango.dev/docs/guides/primitives/auth.md) to integrate Nango in your app.

To obtain a bot token, follow the connect guide linked below.

## Common Scopes

Discord bots are not authorized with OAuth scopes. Instead, a bot's capabilities are controlled by:

* The **permissions** granted when the bot is invited to a server (guild), encoded in the invite URL.
* The **privileged gateway intents** enabled in the Discord Developer Portal (e.g. Server Members, Message Content).

## 📚 Discord Bot Integration Guides

Nango-maintained guides for common use cases.

* [How do I link my Discord bot?](https://nango.dev/docs/api-integrations/discord-bot/connect)
  Learn how to create a Discord application, obtain your bot token, and link your account.

Official docs: [Discord Developer Portal](https://discord.com/developers/docs/intro)

## API gotchas

* Discord bot tokens authenticate with the `Bot` prefix (`Authorization: Bot <token>`), which Nango handles automatically. This is different from the OAuth-based [Discord](https://nango.dev/docs/api-integrations/discord.md) integration, which yields user access tokens authenticated with `Bearer`.
* Resetting a bot token in the Discord Developer Portal invalidates the previous token immediately.
* Some API endpoints require privileged gateway intents to be enabled for your application in the Discord Developer Portal.

## Pre-built syncs & actions for Discord Bot

Explore Nango-provided actions in your dashboard. Extend and customize them to fit your needs.

## Pre-built tooling

> **✅ Authorization**
>
> | Tools | Status |
> | - | - |
> | Pre-built authorization (API Key) | ✅ |
> | Pre-built authorization UI | ✅ |
> | Custom authorization UI | ✅ |
> | End-user authorization guide | ✅ |
> | Expired credentials detection | ✅ |

> **✅ Read & write data**
>
> | Tools | Status |
> | - | - |
> | Pre-built integrations | 🚫 (time to contribute: \<48h) |
> | API unification | ✅ |
> | 2-way sync | ✅ |
> | Webhooks from Nango on data modifications | ✅ |
> | Real-time webhooks from 3rd-party API | 🚫 (time to contribute: \<48h) |
> | Proxy requests | ✅ |

> **✅ Observability & data quality**
>
> | Tools | Status |
> | - | - |
> | HTTP request logging | ✅ |
> | End-to-end type safety | ✅ |
> | Data runtime validation | ✅ |
> | OpenTelemetry export | ✅ |
> | Slack alerts on errors | ✅ |
> | Integration status API | ✅ |

> **✅ Customization**
>
> | Tools | Status |
> | - | - |
> | Create or customize use-cases | ✅ |
> | Pre-configured pagination | 🚫 (time to contribute: \<48h) |
> | Pre-configured rate-limit handling | 🚫 (time to contribute: \<48h) |
> | Per-customer configurations | ✅ |

*No pre-built syncs or actions available yet.*

> [!TIP]
>
> Not seeing the integration you need? [Build your own](https://nango.dev/docs/guides/functions/functions-guide.md) independently.

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.