Plugin Credentials Guide
Step-by-step instructions for obtaining credentials for all plugins
This guide provides detailed instructions for obtaining all required credentials for each Corsair plugin. Each plugin section includes step-by-step instructions, required vs optional credentials, and webhook setup where applicable.
Overview
Corsair plugins require different types of credentials depending on their authentication method:
- API Keys: Static keys or tokens used for authentication (e.g., Slack bot tokens, Linear API keys)
- OAuth 2.0: Client ID, Client Secret, Access Token, and Refresh Token for user authorization
- Webhook Secrets: Secrets used to verify incoming webhook requests
For general information about how Corsair handles authentication, see Authentication.
Table of Contents
Slack
The Slack plugin supports both API key (bot token) and OAuth 2.0 authentication methods.
Authentication Methods
api_key(default) - Bot token authenticationoauth_2- OAuth 2.0 user authentication
API Key Authentication (Bot Token)
Step 1: Create a Slack App
- Go to api.slack.com/apps
- Click Create New App
- Choose From scratch
- Enter your app name and select your workspace
- Click Create App
Step 2: Configure Bot Token Scopes
- In your app settings, go to OAuth & Permissions in the left sidebar
- Scroll to Scopes → Bot Token Scopes
- Add the required scopes:
channels:read- View basic information about public channelschannels:write- Manage public channelschat:write- Send messagesfiles:read- View files shared in channelsfiles:write- Upload, edit, and delete filesusers:read- View people in a workspacereactions:write- Add and remove emoji reactions- Add any other scopes your application needs
Step 3: Install App to Workspace
- Scroll to the top of the OAuth & Permissions page
- Click Install to Workspace
- Review the permissions and click Allow
Step 4: Copy Bot Token
- After installation, you'll be redirected back to OAuth & Permissions
- Under OAuth Tokens for Your Workspace, find Bot User OAuth Token
- Click Copy to copy the token (starts with
xoxb-) - Store this token securely
Example Configuration:
slack({
authType: "api_key",
key: process.env.SLACK_BOT_TOKEN,
})OAuth 2.0 Authentication
Step 1: Create a Slack App
Follow steps 1-3 from the API Key Authentication section above.
Step 2: Configure OAuth Settings
- Go to OAuth & Permissions in the left sidebar
- Under Redirect URLs, click Add New Redirect URL
- Add your OAuth redirect URL (e.g.,
https://yourapp.com/auth/slack/callback) - Click Save URLs
Step 3: Get Client Credentials
- Scroll to App Credentials section
- Copy the Client ID and Client Secret
- Store these securely
Example Configuration:
slack({
authType: "oauth_2",
})The plugin will automatically retrieve access tokens from your database after users complete the OAuth flow.
Webhook Signing Secret
Step 1: Enable Event Subscriptions
- In your Slack app settings, go to Event Subscriptions in the left sidebar
- Toggle Enable Events to On
- Enter your Request URL (e.g.,
https://yourapp.com/api/webhook) - Slack will send a verification request - ensure your endpoint handles it
Step 2: Subscribe to Bot Events
- Scroll to Subscribe to bot events
- Click Add Bot User Event
- Add events you want to receive:
message.channels- Messages posted to channelschannel_created- A channel was createdreaction_added- A reaction was addedteam_join- A new member joineduser_change- A user's profile was updatedfile_created- A file was createdfile_public- A file was made publicfile_shared- A file was shared
Step 3: Get Signing Secret
- Scroll to the top of the Event Subscriptions page
- Under Signing Secret, click Show and copy the secret
- Store this securely
Example Configuration:
slack({
signingSecret: process.env.SLACK_SIGNING_SECRET,
})Required Credentials Summary
| Credential | Required For | Where to Find |
|---|---|---|
Bot Token (xoxb-...) | API Key auth | OAuth & Permissions → Bot User OAuth Token |
| Client ID | OAuth 2.0 | OAuth & Permissions → App Credentials |
| Client Secret | OAuth 2.0 | OAuth & Permissions → App Credentials |
| Signing Secret | Webhooks | Event Subscriptions → Signing Secret |
GitHub
The GitHub plugin supports both API key (Personal Access Token) and OAuth 2.0 authentication methods.
Authentication Methods
api_key- Personal Access Token authenticationoauth_2- OAuth App authentication
API Key Authentication (Personal Access Token)
Step 1: Create Personal Access Token
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click Generate new token → Generate new token (classic)
- Give your token a descriptive name
- Set an expiration (or select "No expiration" for long-lived tokens)
- Select the required scopes:
repo- Full control of private repositoriesread:org- Read org and team membershipread:user- Read user profile dataworkflow- Update GitHub Action workflows- Add any other scopes your application needs
- Click Generate token
- Important: Copy the token immediately - you won't be able to see it again
- Store the token securely
Example Configuration:
github({
authType: "api_key",
credentials: {
token: process.env.GITHUB_TOKEN,
},
})OAuth 2.0 Authentication
Step 1: Register OAuth App
- Go to GitHub Settings → Developer settings → OAuth Apps
- Click New OAuth App
- Fill in the application details:
- Application name: Your app name
- Homepage URL: Your application URL
- Authorization callback URL: Your OAuth callback URL (e.g.,
https://yourapp.com/auth/github/callback)
- Click Register application
Step 2: Get Client Credentials
- After registration, you'll see your Client ID
- Click Generate a new client secret
- Copy the Client ID and Client Secret
- Store these securely
Example Configuration:
github({
authType: "oauth_2",
credentials: {
clientId: process.env.GITHUB_CLIENT_ID,
clientSecret: process.env.GITHUB_CLIENT_SECRET,
},
})Webhook Secret
Step 1: Create Webhook
- Go to your repository on GitHub
- Navigate to Settings → Webhooks
- Click Add webhook
- Configure the webhook:
- Payload URL: Your webhook endpoint (e.g.,
https://yourapp.com/api/webhook) - Content type:
application/json - Secret: Generate a random secret string (save this)
- Events: Select the events you want to receive:
- Pull requests
- Pushes
- Issues
- Stars
- Releases
- Payload URL: Your webhook endpoint (e.g.,
- Click Add webhook
Step 2: Store Webhook Secret
Copy the secret you generated and store it securely.
Example Configuration:
github({
webhookSecret: process.env.GITHUB_WEBHOOK_SECRET,
})Required Credentials Summary
| Credential | Required For | Where to Find |
|---|---|---|
| Personal Access Token | API Key auth | Settings → Developer settings → Personal access tokens |
| Client ID | OAuth 2.0 | Settings → Developer settings → OAuth Apps |
| Client Secret | OAuth 2.0 | Settings → Developer settings → OAuth Apps |
| Webhook Secret | Webhooks | Repository Settings → Webhooks → Secret |
Gmail
The Gmail plugin uses OAuth 2.0 authentication exclusively.
Authentication Method
oauth_2(default) - OAuth 2.0 authentication
OAuth 2.0 Setup
Step 1: Create Google Cloud Project
- Go to Google Cloud Console
- Click Select a project → New Project
- Enter a project name and click Create
- Wait for the project to be created and select it
Step 2: Enable Gmail API
- In the Google Cloud Console, go to APIs & Services → Library
- Search for "Gmail API"
- Click on Gmail API
- Click Enable
Step 3: Create OAuth 2.0 Credentials
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- If prompted, configure the OAuth consent screen:
- Choose External (unless you have a Google Workspace)
- Fill in the required information:
- App name
- User support email
- Developer contact information
- Add scopes:
https://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/gmail.compose
- Add test users (for testing)
- Click Save and Continue through all steps
- Back in Credentials, click Create Credentials → OAuth client ID
- Select Web application
- Configure:
- Name: Your application name
- Authorized redirect URIs: Add your callback URL (e.g.,
https://yourapp.com/auth/gmail/callback)
- Click Create
- Copy the Client ID and Client Secret
- Store these securely
Example Configuration:
gmail({
authType: "oauth_2",
credentials: {
clientId: process.env.GMAIL_CLIENT_ID,
clientSecret: process.env.GMAIL_CLIENT_SECRET,
},
})The plugin will automatically handle access token and refresh token storage after users complete the OAuth flow.
Required Credentials Summary
| Credential | Required For | Where to Find |
|---|---|---|
| Client ID | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials |
| Client Secret | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials |
| Access Token | OAuth 2.0 | Obtained automatically after OAuth flow |
| Refresh Token | OAuth 2.0 | Obtained automatically after OAuth flow |
Google Sheets
The Google Sheets plugin uses OAuth 2.0 authentication exclusively.
Authentication Method
oauth_2(default) - OAuth 2.0 authentication
OAuth 2.0 Setup
Step 1: Create Google Cloud Project
- Go to Google Cloud Console
- Click Select a project → New Project
- Enter a project name and click Create
- Wait for the project to be created and select it
Step 2: Enable Google Sheets API
- In the Google Cloud Console, go to APIs & Services → Library
- Search for "Google Sheets API"
- Click on Google Sheets API
- Click Enable
Step 3: Create OAuth 2.0 Credentials
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- If prompted, configure the OAuth consent screen (see Gmail section for details)
- Select Web application
- Configure:
- Name: Your application name
- Authorized redirect URIs: Add your callback URL (e.g.,
https://yourapp.com/auth/googlesheets/callback)
- Click Create
- Copy the Client ID and Client Secret
- Store these securely
Example Configuration:
googlesheets({
authType: "oauth_2",
credentials: {
clientId: process.env.GOOGLE_SHEETS_CLIENT_ID,
clientSecret: process.env.GOOGLE_SHEETS_CLIENT_SECRET,
},
})Required Credentials Summary
| Credential | Required For | Where to Find |
|---|---|---|
| Client ID | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials |
| Client Secret | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials |
| Access Token | OAuth 2.0 | Obtained automatically after OAuth flow |
| Refresh Token | OAuth 2.0 | Obtained automatically after OAuth flow |
Google Drive
The Google Drive plugin uses OAuth 2.0 authentication exclusively.
Authentication Method
oauth_2(default) - OAuth 2.0 authentication
OAuth 2.0 Setup
Step 1: Create Google Cloud Project
- Go to Google Cloud Console
- Click Select a project → New Project
- Enter a project name and click Create
- Wait for the project to be created and select it
Step 2: Enable Google Drive API
- In the Google Cloud Console, go to APIs & Services → Library
- Search for "Google Drive API"
- Click on Google Drive API
- Click Enable
Step 3: Create OAuth 2.0 Credentials
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- If prompted, configure the OAuth consent screen (see Gmail section for details)
- Select Web application
- Configure:
- Name: Your application name
- Authorized redirect URIs: Add your callback URL (e.g.,
https://yourapp.com/auth/googledrive/callback)
- Click Create
- Copy the Client ID and Client Secret
- Store these securely
Example Configuration:
googledrive({
authType: "oauth_2",
credentials: {
clientId: process.env.GOOGLE_DRIVE_CLIENT_ID,
clientSecret: process.env.GOOGLE_DRIVE_CLIENT_SECRET,
},
})Required Credentials Summary
| Credential | Required For | Where to Find |
|---|---|---|
| Client ID | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials |
| Client Secret | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials |
| Access Token | OAuth 2.0 | Obtained automatically after OAuth flow |
| Refresh Token | OAuth 2.0 | Obtained automatically after OAuth flow |
Google Calendar
The Google Calendar plugin uses OAuth 2.0 authentication exclusively.
Authentication Method
oauth_2(default) - OAuth 2.0 authentication
OAuth 2.0 Setup
Step 1: Create Google Cloud Project
- Go to Google Cloud Console
- Click Select a project → New Project
- Enter a project name and click Create
- Wait for the project to be created and select it
Step 2: Enable Google Calendar API
- In the Google Cloud Console, go to APIs & Services → Library
- Search for "Google Calendar API"
- Click on Google Calendar API
- Click Enable
Step 3: Create OAuth 2.0 Credentials
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- If prompted, configure the OAuth consent screen (see Gmail section for details)
- Select Web application
- Configure:
- Name: Your application name
- Authorized redirect URIs: Add your callback URL (e.g.,
https://yourapp.com/auth/googlecalendar/callback)
- Click Create
- Copy the Client ID and Client Secret
- Store these securely
Example Configuration:
googlecalendar({
authType: "oauth_2",
credentials: {
clientId: process.env.GOOGLE_CALENDAR_CLIENT_ID,
clientSecret: process.env.GOOGLE_CALENDAR_CLIENT_SECRET,
},
})Required Credentials Summary
| Credential | Required For | Where to Find |
|---|---|---|
| Client ID | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials |
| Client Secret | OAuth 2.0 | Google Cloud Console → APIs & Services → Credentials |
| Access Token | OAuth 2.0 | Obtained automatically after OAuth flow |
| Refresh Token | OAuth 2.0 | Obtained automatically after OAuth flow |
HubSpot
The HubSpot plugin supports both API key and OAuth 2.0 authentication methods.
Authentication Methods
api_key- Private App API key authenticationoauth_2- OAuth 2.0 authentication
API Key Authentication (Private App)
Step 1: Create Private App
- Go to HubSpot Settings
- Navigate to Integrations → Private Apps
- Click Create a private app
- Enter an app name
- Click Create app
Step 2: Configure Scopes
- In your private app settings, go to Scopes tab
- Select the required scopes:
crm.objects.contacts.readcrm.objects.contacts.writecrm.objects.companies.readcrm.objects.companies.writecrm.objects.deals.readcrm.objects.deals.writecrm.objects.tickets.readcrm.objects.tickets.writeengagements.readengagements.write- Add any other scopes your application needs
- Click Save
Step 3: Get API Key
- Go to the Overview tab
- Under API key, click Show to reveal the key
- Copy the API key
- Store it securely
Example Configuration:
hubspot({
authType: "api_key",
credentials: {
apiKey: process.env.HUBSPOT_API_KEY,
},
})OAuth 2.0 Authentication
Step 1: Create App
- Go to HubSpot Developer Portal
- Click Create app
- Enter your app name and click Create app
Step 2: Configure OAuth Settings
- In your app settings, go to Auth tab
- Under Redirect URLs, click Add
- Add your OAuth redirect URL (e.g.,
https://yourapp.com/auth/hubspot/callback) - Click Save
Step 3: Get Client Credentials
- In the Auth tab, you'll see your Client ID
- Click Show next to Client Secret to reveal it
- Copy the Client ID and Client Secret
- Store these securely
Example Configuration:
hubspot({
authType: "oauth_2",
credentials: {
clientId: process.env.HUBSPOT_CLIENT_ID,
clientSecret: process.env.HUBSPOT_CLIENT_SECRET,
},
})Webhook Secret
Step 1: Create Webhook Subscription
- Go to HubSpot Settings
- Navigate to Integrations → Private Apps
- Select your private app (or create one if needed)
- Go to Webhooks tab
- Click Create subscription
- Configure:
- Event type: Select from:
- Contact created/updated/deleted
- Company created/updated/deleted
- Deal created/updated/deleted
- Ticket created/updated/deleted
- Webhook URL: Your webhook endpoint (e.g.,
https://yourapp.com/api/webhook)
- Event type: Select from:
- Click Save
- If a webhook secret is provided, copy it and store securely
Example Configuration:
hubspot({
webhookSecret: process.env.HUBSPOT_WEBHOOK_SECRET,
})Required Credentials Summary
| Credential | Required For | Where to Find |
|---|---|---|
| API Key | API Key auth | Settings → Integrations → Private Apps → Overview |
| Client ID | OAuth 2.0 | Developer Portal → App Settings → Auth |
| Client Secret | OAuth 2.0 | Developer Portal → App Settings → Auth |
| Webhook Secret | Webhooks | Settings → Integrations → Private Apps → Webhooks |
Linear
The Linear plugin uses API key authentication.
Authentication Method
api_key(default) - Personal API key authentication
API Key Setup
Step 1: Generate API Key
- Go to Linear Settings → API
- Navigate to the API section
- Under Personal API keys, click Create API key
- Give your key a name (e.g., "Corsair Integration")
- Copy the API key immediately
- Important: Store the key securely - you won't be able to see it again
Example Configuration:
linear({
authType: "api_key",
key: process.env.LINEAR_API_KEY,
})Webhook Secret
Step 1: Create Webhook
- Go to Linear Settings → API
- Navigate to Webhooks section
- Click Create Webhook
- Configure:
- Label: Your webhook name
- URL: Your webhook endpoint (e.g.,
https://yourapp.com/api/webhook) - Resource types: Select:
- Issues
- Comments
- Projects
- Click Create Webhook
- After creation, copy the Signing Secret shown
- Store it securely
Example Configuration:
linear({
webhookSecret: process.env.LINEAR_WEBHOOK_SECRET,
})Required Credentials Summary
| Credential | Required For | Where to Find |
|---|---|---|
| API Key | API Key auth | Settings → API → Personal API keys |
| Webhook Secret | Webhooks | Settings → API → Webhooks → Signing Secret |
PostHog
The PostHog plugin uses API key authentication.
Authentication Method
api_key(default) - Project API key authentication
API Key Setup
Step 1: Get Project API Key
- Log in to your PostHog account
- Navigate to Project Settings
- Click on Project API Key in the left sidebar
- Copy your Project API Key
- Store it securely
Example Configuration:
posthog({
authType: "api_key",
key: process.env.POSTHOG_API_KEY,
})Personal API Key (Optional)
For advanced API access, you can also create a Personal API Key:
- In PostHog, click on your profile icon (top right)
- Go to Personal API Keys
- Click Create Personal API Key
- Give it a name and copy the key
- Important: Store this key securely - you won't be able to see it again
Webhook Secret
Step 1: Create Webhook Destination
- Go to your PostHog project settings
- Navigate to Data Pipelines → Destinations
- Click New destination
- Select Webhook as the destination type
- Configure:
- Webhook URL: Your webhook endpoint (e.g.,
https://yourapp.com/api/webhook) - Events: Select
event_capturedor all events
- Webhook URL: Your webhook endpoint (e.g.,
- Click Save
- If a webhook secret is provided, copy it and store securely
Example Configuration:
posthog({
webhookSecret: process.env.POSTHOG_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 |
Resend
The Resend plugin uses API key authentication.
Authentication Method
api_key(default) - API key authentication
API Key Setup
Step 1: Get API Key
- Log in to your Resend account
- Navigate to API Keys in the dashboard
- Click Create API Key
- Give your key a name (e.g., "Corsair Integration")
- Select the required permissions
- Click Create
- Copy the API key immediately
- Important: Store the key securely - you won't be able to see it again
Example Configuration:
resend({
authType: "api_key",
key: process.env.RESEND_API_KEY,
})Webhook Secret
Step 1: Create Webhook
- In your Resend dashboard, go to Webhooks
- Click Add Webhook
- Configure:
- Webhook URL: Your webhook endpoint (e.g.,
https://yourapp.com/api/webhook) - Events: Select the events you want to receive:
email.sentemail.deliveredemail.bouncedemail.openedemail.clickedemail.complainedemail.failedemail.receiveddomain.createddomain.updated
- Webhook URL: Your webhook endpoint (e.g.,
- Click Add Webhook
- After creation, copy the Signing Secret shown
- Store it securely
Example Configuration:
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 |
Security Best Practices
When working with credentials:
- Never commit credentials to version control - Use environment variables or a secrets manager
- Use environment variables - Store credentials in
.envfiles (and add.envto.gitignore) - Rotate credentials regularly - Periodically regenerate API keys and tokens
- Use least privilege - Only grant the minimum scopes/permissions needed
- Monitor usage - Regularly check for unauthorized access or unusual activity
- Use secrets managers - For production, consider using AWS Secrets Manager, HashiCorp Vault, or similar
For more information on how Corsair handles credential security, see Authentication.