Overview
Theaiybiz start --handler command lets you plug in any AI logic as a JavaScript/TypeScript function. The SDK handles:
- Session authentication
- Incoming message delivery
- Outgoing message routing
- Reconnection and heartbeat
Handler interface
Context object
| Property | Type | Description |
|---|---|---|
message.id | string | Message ID |
message.content | string | Client’s message text |
message.createdAt | Date | When the message was sent |
session.id | string | Session ID |
session.agentAuthToken | string | Verified auth token |
reply(text) | function | Send a reply to the client |
sendTyping() | function | Emit a typing indicator |
TypeScript
Starting the SDK
ts-node):