Module: Defaults
Centralized configuration constants used throughout the library. Contains all API URLs,
service names, timeouts, and default values.
Source: src/Defaults/index.js
const { Defaults } = require('arattix');
console.log(Defaults.CHAT_API);
// "https://web.arattai.in/v1/chats"
Base URLs
| Constant | Value | Description |
WEB_BASE_URL |
"https://web.arattai.in" |
Web app base URL |
ACCOUNTS_BASE_URL |
"https://accounts.arattai.in" |
Auth server base URL |
FILES_BASE_URL |
"https://files.arattai.in" |
File server base URL |
API Endpoints
| Constant | Type | Description |
CHAT_API |
string |
V1 Chat list endpoint: https://web.arattai.in/v1/chats |
MESSAGES_API(chatId) |
function |
V2 Messages endpoint — returns live data |
SEND_MESSAGE_URL |
string |
Send text message endpoint |
FILE_UPLOAD_URL |
string |
File upload endpoint |
FILE_DOWNLOAD_URL |
string |
UDS file download endpoint |
ATTACHMENTS_URL(fileId) |
function |
V1 attachments fallback download |
QR_AUTH_URL |
string |
QR code auth endpoint |
// Dynamic URL functions:
const url = Defaults.MESSAGES_API('chat_12345');
// "https://web.arattai.in/v2/chats/chat_12345/messages"
const dlUrl = Defaults.ATTACHMENTS_URL('file_abc');
// "https://web.arattai.in/v1/attachments/file_abc"
Service Names
| Constant | Value | Description |
DOWNLOAD_SERVICE |
"CLIQ" |
x-service header for downloads. Must be "CLIQ" |
UPLOAD_SERVICE |
"arattai" |
x-service header for uploads |
Important
The DOWNLOAD_SERVICE must be "CLIQ" — using "arattai"
for downloads will return 403 errors. This is a backend requirement of the file server.
Default Values
| Constant | Value | Description |
DEFAULT_USER_AGENT |
string |
Chrome-based User-Agent string |
DEFAULT_TIMEOUT |
10000 |
Default request timeout (10s) |
MEDIA_TIMEOUT |
30000 |
Media download/upload timeout (30s) |
DEFAULT_POLL_INTERVAL |
3000 |
Default bot polling interval (3s) |