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

# Get Credentials

> Step-by-step instructions for obtaining a Discord bot token, application public key, and related credentials for the Corsair Discord plugin.

This guide walks you through obtaining all required credentials for the Discord plugin.

## Authentication Method

The Discord plugin uses API key authentication for the REST API. Internally, Corsair treats your **bot token** as the [`api_key`](/concepts/api-key) value and sends it as `Authorization: Bot <token>`.

* **[`api_key`](/concepts/api-key)** (default) — Bot token for Discord’s API

Discord does **not** use OAuth in this plugin’s `authType` surface; you operate as a bot using the bot token.

## Bot Token (API Key)

### Step 1: Create a Discord Application

1. Open the [Discord Developer Portal](https://discord.com/developers/applications).
2. Click **New Application**, name it, and create it.

### Step 2: Add a Bot and Copy the Token

1. Open your application → **Bot**.
2. Click **Add Bot** if you have not already.
3. Under **Token**, click **Reset Token** or **Copy** to copy the bot token.
4. Store it securely — anyone with the token can control the bot.

**Storing credentials:**

```bash theme={null}
pnpm corsair setup --plugin=discord api_key=your-bot-token
```

Verify:

```bash theme={null}
pnpm corsair auth --plugin=discord --credentials
```

### Step 3: Invite the Bot (Guilds)

In the Developer Portal, use **OAuth2** → **URL Generator** (or **Installation**) to generate an invite URL with the **bot** scope and the permissions your integration needs. Open the URL in a browser and add the bot to the servers you manage.

## Interaction Public Key (Webhooks)

Discord **Interaction** payloads (slash commands, buttons, modals) are signed with Ed25519. Corsair verifies them using your application’s **Public Key**. In the key store, this value is stored as the webhook signing material (`webhook_signature`).

1. In the Developer Portal, open your application → **General Information**.
2. Find **Public Key** and copy it.

**Storing credentials:**

```bash theme={null}
pnpm corsair setup --plugin=discord webhook_signature=your-application-public-key
```

## Required Credentials Summary

| Credential             | Required for                              | Where to find                                      |
| ---------------------- | ----------------------------------------- | -------------------------------------------------- |
| Bot token              | [`api_key`](/concepts/api-key) / REST API | Application → **Bot** → Token                      |
| Application public key | Interaction webhook verification          | Application → **General Information** → Public Key |

For general information about how Corsair handles authentication, see [Authentication](/concepts/auth).
