akarizen-bot-sdk
v0.1.1
Published
Akarizen Bot API SDK for Node.js
Readme
Akarizen Bot SDK (Node.js)
TypeScript SDK for the Akarizen chatbot API. This SDK signs requests with your API key and sends them to the Akarizen callback API.
1. Installation
npm i akarizen-bot-sdk2. Configuration
import { AkarizenClient } from "akarizen-bot-sdk";
const client = new AkarizenClient({
apiKey: "YOUR_API_KEY",
businessId: "BUSINESS_ID",
botId: "BOT_ID"
});Options
baseUrl: Override the API base URL. Default ishttps://resources.studioamk.com/botapi/callback.timeoutMs: Request timeout in milliseconds.jwtOptions: Extra JWT options passed tojsonwebtoken.sign(e.g.,expiresIn).
3. Send Message
const reply = await client.sendMessage({
userId: "user-123",
message: "Hello",
displayName: "Jane"
});Request Body
userId(string, required)message(string, required)displayName(string, optional)
Response
{
"code": "200",
"data": {
"botReply": "Hello",
"conversationId": 123,
"transferredToHuman": false,
"isBotWithinWorkingHours": true,
"blocked": false
}
}4. List Messages
const list = await client.listMessages({
userId: "user-123",
current: 1,
limit: 10
});Request Body
userId(string, required)current(number, optional, default 1)limit(number, optional, default 10)
5. Refresh Conversation
const refreshed = await client.refreshConversation({
userId: "user-123",
conversationId: 42
});Request Body
userId(string, required)conversationId(number or string, required)
Response Wrapper
All endpoints return a standard wrapper:
{
"code": "200",
"status": "OK",
"message": "...",
"data": {}
}Notes
- Your API key is used as the JWT signing secret.
- The platform uses your dashboard callback URL to send responses.
Build
npm run build