achek 1.0.1
achek: ^1.0.1 copied to clipboard
Official Dart SDK for Achek — WhatsApp OTP, AI chatbots & business messaging for Nigeria.
achek — Dart SDK #
Official Dart SDK for Achek — WhatsApp & Telegram OTP, messaging, and broadcasts for Nigeria and Africa.
Installation #
Add to your pubspec.yaml:
dependencies:
achek: ^1.0.0
Then run:
dart pub get
Quick Start #
import 'package:achek/achek.dart';
final client = AchekClient(apiKey: 'your_api_key');
// Send WhatsApp OTP
final res = await client.otp.send('+2348012345678');
// Verify the code the user entered
final result = await client.otp.verify(res.requestId, '847291');
if (result.valid) {
print('User verified!'); // ✅
}
Get your API key from the Achek dashboard.
WhatsApp OTP #
// Simple send
final res = await client.otp.send('+2348012345678');
final requestId = res.requestId;
// With custom template (Growth+ plans)
final res = await client.otp.send(
'+2348012345678',
template: 'Hi, your MyApp login code is {{code}}. Valid 10 mins.',
length: 6,
expiryMinutes: 10,
);
// Verify
final result = await client.otp.verify(requestId, '847291');
print(result.valid); // true
WhatsApp Messaging #
// Send a direct message
await client.messaging.sendMessage(
'+2348012345678',
'Your order #1234 has shipped! 🚚',
);
// Broadcast to multiple numbers (up to 100)
await client.messaging.sendBroadcast(
['+2348012345678', '+2349087654321'],
'🎉 Flash sale — 40% off everything today!',
);
Telegram OTP #
// User must have sent /start to your Telegram bot first
final tgRes = await client.telegram.sendOtp(
'123456789', // Telegram chat_id
appName: 'MyApp',
);
print('OTP sent via Telegram');
Telegram Messaging #
// Send a direct message
await client.telegram.sendMessage(
'123456789',
'Your account <b>Emeka</b> has been verified.',
);
// Broadcast to multiple Telegram users
await client.telegram.sendBroadcast(
['123456789', '987654321'],
'📣 New update: version 2.0 is live!',
);
Error Handling #
try {
await client.otp.send('+2348012345678');
} on AchekException catch (e) {
print('Error ${e.statusCode}: ${e.message}');
}
Configuration #
final client = AchekClient(
apiKey: 'your_api_key',
baseUrl: 'https://api.achek.com.ng', // override if self-hosted
);
API Reference #
| Module | Method | Description |
|---|---|---|
otp |
send(phone, {...}) |
Send WhatsApp OTP |
otp |
verify(requestId, code) |
Verify OTP code |
messaging |
sendMessage(phone, message) |
Send WhatsApp message |
messaging |
sendBroadcast(phones, message) |
Broadcast via WhatsApp |
telegram |
sendOtp(chatId, {appName}) |
Send Telegram OTP |
telegram |
sendMessage(chatId, message) |
Send Telegram message |
telegram |
sendBroadcast(chatIds, message) |
Broadcast via Telegram |
Links #
- Website: achek.com.ng
- Dashboard: achek.com.ng/dashboard
- Docs: achek.com.ng/docs
- Issues: github.com/CalebDevX/achek-dart/issues
License #
MIT — see LICENSE