IntegrationSpecificClient provides a type-safe API client for integration operations. It’s automatically typed based on your integration definition and available in all handlers.
Overview
The client is passed to all integration handlers with full TypeScript support for:- Creating and managing conversations
- Sending messages to bots
- Managing users
- Getting and setting state
- Creating events
- File operations
Usage
Conversation Methods
createConversation
Create a conversation with type-safe channel and tags.getOrCreateConversation
Get existing conversation or create new one.updateConversation
Update conversation tags.Message Methods
createMessage
Create a message and trigger bot processing. Type and payload are based on channel message definitions.getOrCreateMessage
Get or create a message using tags for deduplication.initializeIncomingMessage
Create user, conversation, and message in one operation.User Methods
createUser
Create a user with integration-specific tags.getOrCreateUser
Get or create a user.updateUser
Update user tags.State Methods
State operations are fully typed based on your state definitions.getState
setState
patchState
Event Methods
createEvent
Create a typed event that bots can listen to.Configuration Methods
configureIntegration
Update integration configuration.File Methods
uploadFile
getFile
listFiles
deleteFile
Analytics
trackAnalytics
See Also
- IntegrationDefinition - Define integration
- IntegrationImplementation - Implement handlers
- IntegrationContext - Runtime context