> ## 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 Twitter/X OAuth 2.0 credentials.

This guide walks you through obtaining OAuth 2.0 credentials for the Twitter plugin.

## Authentication Method

The Twitter plugin uses OAuth 2.0 authentication.

* **[`oauth_2`](/concepts/oauth)** - OAuth 2.0 user authentication

## OAuth 2.0 Setup

### Step 1: Create a Twitter Developer App

1. Go to [developer.twitter.com](https://developer.twitter.com/en/portal/dashboard)
2. Click **+ Add app** or **Create Project**
3. Fill in the app name and description
4. Select **OAuth 2.0** as the authentication type

### Step 2: Configure OAuth Settings

1. In your app settings, go to **User authentication settings**
2. Enable **OAuth 2.0**
3. Set **App permissions** to **Read and write**
4. Add your **Callback URI** (e.g., `http://localhost:<port>` for CLI flow)
5. Add your **Website URL**
6. Click **Save**

### Step 3: Get Client Credentials

1. Go to **Keys and Tokens**
2. Copy the **OAuth 2.0 Client ID** and **Client Secret**
3. Store these securely

**Storing Credentials:**

Store your OAuth app credentials, then start the flow:

```bash theme={null}
pnpm corsair setup --plugin=twitter client_id=your-client-id client_secret=your-client-secret
pnpm corsair auth --plugin=twitter
```

The CLI will print an authorization URL — open it in a browser. Once you approve, tokens are saved automatically.

## Required Credentials Summary

| Credential    | Required For | Where to Find                      |
| ------------- | ------------ | ---------------------------------- |
| Client ID     | OAuth 2.0    | Developer Portal → Keys and Tokens |
| Client Secret | OAuth 2.0    | Developer Portal → Keys and Tokens |

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