Skip to main content

What are Integrations?

Integrations are packages that connect Botpress bots to external platforms and services. They provide:
  • Channels: Communication pathways (Telegram chats, Slack channels, etc.)
  • Actions: Operations to perform on the platform (send message, create channel)
  • Events: Platform-specific events (message received, user joined)
  • Entities: Data models specific to the platform (users, conversations)
Integrations act as adapters between Botpress’s unified bot interface and external platform APIs.

Integration Architecture

Creating an Integration

Integration Definition

From packages/sdk/src/integration/definition/index.ts:177, integrations are defined using IntegrationDefinition:

Integration Implementation

The implementation lives in src/index.ts:

Using Integrations in Bots

Add integrations to your bot:
You can install multiple instances of the same integration with different configurations using unique aliases.

Implementing Interfaces

Integrations can implement interfaces to provide standard functionality. From packages/sdk/src/integration/definition/index.ts:246:

Why Implement Interfaces?

  1. Interoperability: Plugins can use any integration implementing the same interface
  2. Standardization: Common operations (LLM, storage, etc.) have consistent APIs
  3. Swappability: Switch between providers without changing bot code

Channels

Channels define how messages flow between the bot and platform:
Disable specific channels when adding to a bot:

Multiple Configurations

Integrations can support multiple configuration schemas:

Identity Extraction

Extract user identity from platform-specific data:

Secrets Management

Define secrets for sensitive configuration:
Secrets are never exposed in logs or client-side code. They’re only accessible server-side in action handlers.

States

Integrations can define their own state:

Publishing Integrations

1

Develop

Create and test your integration locally:
2

Deploy Private

Deploy to your workspace for testing:
3

Test

Install in a test bot and verify functionality
4

Deploy Public

Make it available on the Botpress Hub:
Once a version is deployed as public, it cannot be modified. Always test thoroughly with private deployments first.

Advanced Features

Custom Metadata

ESBuild Configuration

Best Practices

Error Handling

Always handle external API errors gracefully. Use try-catch blocks and return meaningful error messages.

Rate Limiting

Implement rate limiting to avoid hitting platform API limits. Use queues for high-volume operations.

Idempotency

Make webhook handlers idempotent. The same webhook may be delivered multiple times.

Validation

Validate all incoming data with Zod schemas. Never trust external data.

Next Steps

Interfaces

Learn how to implement standard interfaces

Plugins

Use interfaces to build cross-platform plugins

Examples

Browse integration examples

Hub

Explore published integrations