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

<Steps>
  <Step title="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*.
  </Step>

  <Step title="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.
  </Step>

  <Step title="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](/docs/reference/backend/http-api/api-keys), [integration ID](https://app.nango.dev/dev/integrations), and [connection ID](https://app.nango.dev/dev/connections):

    <Tabs>
      <Tab title="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>"
        ```
      </Tab>

      <Tab title="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);
        ```
      </Tab>
    </Tabs>

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

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

  <Step title="Implement Nango in your app">
    Follow our [Auth implementation guide](/docs/guides/primitives/auth) to integrate Nango in your app.

    To obtain a bot token, follow the connect guide linked below.
  </Step>
</Steps>

## 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?](/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](/docs/api-integrations/discord) 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

Enable them in your dashboard. Extend and customize to fit your needs.

## Pre-built tooling

<AccordionGroup>
  <Accordion title="✅ Authorization">
    | Tools | Status |
    | - | - |
    | Pre-built authorization (API Key) | ✅ |
    | Pre-built authorization UI | ✅ |
    | Custom authorization UI | ✅ |
    | End-user authorization guide | ✅ |
    | Expired credentials detection | ✅ |
  </Accordion>

  <Accordion title="✅ 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 | ✅ |
  </Accordion>

  <Accordion title="✅ 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 | ✅ |
  </Accordion>

  <Accordion title="✅ 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 | ✅ |
  </Accordion>
</AccordionGroup>

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

<Tip>Not seeing the integration you need? [Build your own](/docs/guides/functions/functions-guide) independently.</Tip>

***


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