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

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

## Authentication Method

The PostHog plugin uses API key authentication.

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

## API Key Setup

### Step 1: Get Project API Key

1. Log in to your [PostHog account](https://app.posthog.com)
2. Navigate to **Project Settings**
3. Click on **Project API Key** in the left sidebar
4. Copy your **Project API Key**
5. Store it securely

**Storing Credentials:**

Store the API key with the Corsair CLI:

```bash theme={null}
pnpm corsair setup --plugin=posthog api_key=your-api-key
```

Verify it was saved:

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

## Personal API Key (Optional)

For advanced API access, you can also create a Personal API Key:

1. In PostHog, click on your profile icon (top right)
2. Go to **Personal API Keys**
3. Click **Create Personal API Key**
4. Give it a name and copy the key
5. **Important**: Store this key securely - you won't be able to see it again

## Webhook Secret

### Step 1: Create Webhook Destination

1. Go to your PostHog project settings
2. Navigate to **Data Pipelines** → **Destinations**
3. Click **New destination**
4. Select **Webhook** as the destination type
5. Configure:
   * **Webhook URL**: Your webhook endpoint (e.g., `https://yourapp.com/api/webhook`)
   * **Events**: Select `event_captured` or all events
6. Click **Save**
7. If a webhook secret is provided, copy it and store securely

**Storing Credentials:**

Store the webhook secret with the CLI:

```bash theme={null}
pnpm corsair setup --plugin=posthog webhook_signature=your-webhook-secret
```

## Required Credentials Summary

| Credential       | Required For                   | Where to Find                           |
| ---------------- | ------------------------------ | --------------------------------------- |
| Project API Key  | API Key auth                   | Project Settings → Project API Key      |
| Personal API Key | Advanced API access (optional) | Profile → Personal API Keys             |
| Webhook Secret   | Webhooks                       | Data Pipelines → Destinations → Webhook |

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