Installation
- npm
- yarn
Requirements
- Node.js 16.0 or later (server environments)
- Modern browser with Fetch API support (browser environments)
- Valid WSAPI API key and instance ID
Quick start
Features
- HTTP Client — strongly-typed client supporting all API operations across messages, groups, chats, and contacts
- Real-time Events — dual event delivery through webhooks (HTTP POST) or SSE with persistent connections
- TypeScript Support — complete type safety with comprehensive type definitions
- Error Handling — both exception-throwing and non-throwing variants for each API method
- Cross-Platform — compatible with Node.js, browsers, and other JavaScript runtimes
Error handling
The SDK provides two error handling patterns:- Exception-based
- Try-based (non-throwing)
Methods throw exceptions on failure. Use standard
try/catch: