Initialize integration
Create a new integration project:- Integration name (format:
workspace-handle/integration-name) - Workspace handle
- Template (if multiple available)
Integration names must include your workspace handle, for example:
acme/slack or mycompany/custom-api.Project structure
A typical integration project:Define integration
Create the integration definition:integration.definition.ts
Implement integration
Create the integration implementation:src/index.ts
Registration handler
Set up webhooks and initialize resources:src/setup/register.ts
Unregistration handler
Clean up webhooks and resources:src/setup/unregister.ts
Implement actions
Create action handlers:src/actions/send-notification.ts
src/actions/index.ts
Implement channels
Create channel message handlers:src/channels.ts
Build and test
Build your integration:Deploy integration
Deploy to Botpress Cloud:Integrations are deployed to your workspace and can be used by any bot in that workspace.
Add to bot
Use your integration in a bot:bot.definition.ts
src/index.ts
Best practices
1
Error handling
Always handle errors gracefully and provide meaningful error messages
2
Logging
Use the logger to track integration behavior
3
Configuration validation
Validate configuration values before using them
4
State management
Store persistent data in integration state
5
Webhook security
Validate webhook signatures to prevent unauthorized access
Next steps
Integration definition
Learn about integration definition structure
Channels
Implement messaging channels
Actions
Create integration actions
Events
Emit and handle events