
Security News
Google’s OSV Fix Just Added 500+ New Advisories — All Thanks to One Small Policy Change
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
@akson/chatsuite-sdk
Advanced tools
Production-ready TypeScript SDK for ChatSuite - WhatsApp automation with built-in session management, message queuing, webhook server, and database sync
Production-ready TypeScript SDK for ChatSuite - WhatsApp automation with comprehensive session management, message operations, webhooks, and enterprise-grade automation features.
With the enhanced SDK features, reduce implementation complexity by 80-96%:
Feature | Without SDK | With SDK | Reduction |
---|---|---|---|
Session Management | 120 lines | 10 lines | 92% |
Database Sync | 80 lines | 15 lines | 81% |
Message Queue | 60 lines | 8 lines | 87% |
Bot Framework | 100 lines | 25 lines | 75% |
Complete Project | 775 lines | 30 lines | 96% |
npm install @akson/chatsuite-sdk
# or
yarn add @akson/chatsuite-sdk
# or
pnpm add @akson/chatsuite-sdk
import { WhatsAppClient } from '@akson/chatsuite-sdk';
const client = new WhatsAppClient({
apiToken: 'wa_your_token_here'
});
// Send a message
await client.messages.sendText('+1234567890', '1234567890@c.us', 'Hello!');
import { WhatsAppClient, ConsoleExporter } from '@akson/chatsuite-sdk';
const client = new WhatsAppClient({
apiToken: 'wa_your_token_here'
});
// Complete WhatsApp automation in just a few lines
const automation = await client.createAutomation('+1234567890', {
name: 'My WhatsApp Bot',
webhookUrl: 'https://my-server.com/webhook',
// Bot with commands and middleware
bot: {
prefix: '!',
maxCommandsPerMinute: 10
},
// Message queue with rate limiting
queue: {
maxConcurrent: 5,
rateLimitPerMinute: 30
},
// Database sync
database: {
uri: 'mongodb://localhost:27017',
collections: {
messages: 'whatsapp_messages',
chats: 'whatsapp_chats'
}
},
// Smart polling
polling: {
interval: 5 * 60 * 1000,
strategy: 'smart'
},
// Metrics collection
metrics: {
enabled: true,
collectors: ['messages', 'sessions'],
exporters: [new ConsoleExporter()]
}
});
// Bot is ready with all features!
console.log('Automation active:', automation);
Create sophisticated bots with command parsing and middleware:
// Create bot
const bot = client.createBot('+1234567890', {
prefix: '!',
maxCommandsPerMinute: 10
});
// Add middleware
bot.use(middleware.userContext(getUserFromDB));
bot.use(middleware.logging());
// Add commands
bot.addCommand({
name: 'order',
description: 'Check order status',
handler: async (context, args) => {
const orderId = args[0];
const order = await getOrder(orderId);
return `Order ${orderId}: ${order.status}`;
}
});
bot.start();
Handle bulk messaging with rate limiting and priorities:
// Create queue
const queue = client.createMessageQueue({
maxConcurrent: 5,
rateLimitPerMinute: 30
});
// Add messages
await queue.enqueue({
tel: '+1234567890',
chatId: '1234567890@c.us',
content: { text: 'Urgent notification!' },
type: 'text',
priority: 'urgent'
});
queue.start();
Automatically sync WhatsApp data to MongoDB:
// Create database adapter
const dbAdapter = client.createDatabaseAdapter({
uri: 'mongodb://localhost:27017',
collections: { messages: 'whatsapp_messages' },
fieldMapping: {
'key.id': 'messageId',
'messageTimestamp': {
target: 'timestamp',
transform: (ts) => new Date(ts * 1000)
}
}
});
await dbAdapter.connect();
await dbAdapter.sync('messages', messages);
Smart message syncing with adaptive intervals:
// Create polling service
const poller = client.createPollingService('+1234567890', {
interval: 5 * 60 * 1000,
strategy: 'smart'
});
poller.start();
Advanced session handling with health monitoring:
// Create session manager
const sessionManager = client.createSessionManager({
autoRestart: true,
healthCheckInterval: 60000
});
await sessionManager.restoreSession('+1234567890');
Monitor performance and collect observability data:
// Create metrics collector
const metrics = client.createMetricsCollector({
enabled: true,
exporters: [new ConsoleExporter(), new PrometheusExporter()]
});
metrics.increment('messages_sent_total');
metrics.histogram('message_duration_ms', duration);
// List sessions
const sessions = await client.sessions.list();
// Quick session setup with QR polling
const result = await client.quickStart('+1234567890', 'My Bot');
console.log('Scan QR:', result.session.qr);
// Send text
await client.messages.sendText('+1234567890', '1234567890@c.us', 'Hello!');
// Send interactive buttons
await client.messages.sendButtons('+1234567890', '1234567890@c.us', 'Choose:', [
{ id: '1', text: 'Option 1' },
{ id: '2', text: 'Option 2' }
]);
// Send polls
await client.messages.sendPoll('+1234567890', '1234567890@c.us', 'Question?', [
'Option A', 'Option B'
]);
// Create group
const group = await client.groups.create({
tel: '+1234567890',
name: 'Team Chat',
participants: ['user1@c.us', 'user2@c.us']
});
// Business catalog
const products = await client.business.listProducts('+1234567890');
await client.business.createCart('+1234567890', 'customer@c.us');
import { WhatsAppClient, ApiError } from '@akson/chatsuite-sdk';
try {
await client.messages.sendText(tel, to, text);
} catch (error) {
if (error instanceof ApiError) {
console.error('API Error:', {
message: error.message,
status: error.status,
code: error.code
});
}
}
Full TypeScript definitions included:
import {
WhatsAppClient,
Session,
Message,
Contact,
Group,
ApiError
} from '@akson/chatsuite-sdk';
Get your API token from the ChatSuite dashboard:
const client = new WhatsAppClient({
apiToken: 'wa_your_token_here',
baseUrl: 'https://your-instance.com', // optional
timeout: 30000, // optional
maxRetries: 3 // optional
});
MIT License - see LICENSE file for details.
FAQs
Production-ready TypeScript SDK for ChatSuite - WhatsApp automation with built-in session management, message queuing, webhook server, and database sync
The npm package @akson/chatsuite-sdk receives a total of 6 weekly downloads. As such, @akson/chatsuite-sdk popularity was classified as not popular.
We found that @akson/chatsuite-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
Research
/Security News
175 malicious npm packages (26k+ downloads) used unpkg CDN to host redirect scripts for a credential-phishing campaign targeting 135+ organizations worldwide.
Security News
Python 3.14 adds template strings, deferred annotations, and subinterpreters, plus free-threaded mode, an experimental JIT, and Sigstore verification.