Install
Initialize
MESSAGES_API_KEY from your environment. To pass a key explicitly:
Send a message
Receive messages via webhooks
Create a webhook from the Webhooks page in your dashboard and copy the signing secret. Then handle incoming events on your server:verifyWebhook throws a SignatureVerificationError.
List messages
Reactions
Typing indicators
Read receipts
Files
Upload files to send as message attachments:Delivery tracking
Lines
Chats
Webhooks
Pagination
List methods return a page object withdata, hasMore, and nextCursor. Use for await...of to iterate through all results:
Error handling
All errors extendMessagesError and include the error type, code, and message from the API:
Configuration
All options are passed tocreateClient: