> ## 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 Resend API keys and webhook secrets.

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

## Authentication Method

The Resend plugin uses API key authentication.

* **[`api_key`](/concepts/api-key)** (default) - API key authentication

## API Key Setup

### Step 1: Get API Key

1. Log in to your [Resend account](https://resend.com)
2. Navigate to **API Keys** in the dashboard
3. Click **Create API Key**
4. Give your key a name (e.g., "Corsair Integration")
5. Select the required permissions
6. Click **Create**
7. Copy the API key immediately
8. **Important**: Store the key securely - you won't be able to see it again

**Storing Credentials:**

The preferred method is to store the API key in the database using the keys API:

```ts theme={null}
await corsair
    .withTenant('default')
    .resend.keys.setApiKey('your-api-key');
```

Alternatively, you can provide the key directly in the plugin configuration:

```ts corsair.ts theme={null}
resend({
    authType: "api_key",
    key: process.env.RESEND_API_KEY,
})
```

## Webhook Secret

### Step 1: Create Webhook

1. In your Resend dashboard, go to **Webhooks**
2. Click **Add Webhook**
3. Configure:
   * **Webhook URL**: Your webhook endpoint (e.g., `https://yourapp.com/api/webhook`)
   * **Events**: Select the events you want to receive:
     * `email.sent`
     * `email.delivered`
     * `email.bounced`
     * `email.opened`
     * `email.clicked`
     * `email.complained`
     * `email.failed`
     * `email.received`
     * `domain.created`
     * `domain.updated`
4. Click **Add Webhook**
5. After creation, copy the **Signing Secret** shown
6. Store it securely

**Storing Credentials:**

The preferred method is to store the webhook secret in the database using the keys API:

```ts theme={null}
await corsair
    .withTenant('default')
    .resend.keys.setWebhookSignature('your-webhook-secret');
```

Alternatively, you can provide the secret directly in the plugin configuration:

```ts corsair.ts theme={null}
resend({
    webhookSecret: process.env.RESEND_WEBHOOK_SECRET,
})
```

## Required Credentials Summary

| Credential     | Required For | Where to Find                         |
| -------------- | ------------ | ------------------------------------- |
| API Key        | API Key auth | Dashboard → API Keys                  |
| Webhook Secret | Webhooks     | Dashboard → Webhooks → Signing Secret |

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