Quick Start
Install the plugin:corsair.ts
Authentication
Supported Auth Types
The Notion plugin supports:api_key(default) - Use a Notion integration token
Default Auth Type
If noauthType is specified, the plugin defaults to api_key.
Configuring API Key Authentication
Store credentials with the CLI:corsair.ts
Options
| Option | Type | Description |
|---|---|---|
authType | 'api_key' | Authentication method (defaults to 'api_key') |
key | string | Integration token (optional, uses database if not provided) |
webhookSecret | string | Webhook secret for x-notion-signature verification |
hooks | object | Endpoint hooks for custom logic |
webhookHooks | object | Webhook hooks for event handling |
errorHandlers | object | Custom error handlers |
permissions | object | Permission configuration for AI agent access |
Hooks
Error Handling
The plugin includes built-in error handlers for common scenarios. For complete documentation, see the Error Handlers reference.Usage
Accessing the API
Webhooks
Notion sends page lifecycle events to your webhook endpoint:app/api/webhook/route.ts
Database Access
Multi-Tenancy
Examples
Example 1: Create a Task on New GitHub Issue
corsair.ts
inngest/functions.ts
Example 2: Update Notion on Page Created Webhook
corsair.ts
inngest/functions.ts