SDKs
Official client libraries for the OTP API. All of them are thin, dependency-free wrappers over the same two HTTP calls โ pick your stack.
| SDK | Requirements | Download |
|---|---|---|
| PHP | PHP 7.4+, curl | chatrixa-otp-php.zip |
| Laravel | Laravel 9โ12 | chatrixa-otp-laravel.zip |
| Node.js | Node 18+ | chatrixa-otp-node.zip |
| Python | Python 3.8+ | chatrixa-otp-python.zip |
PHP
use Chatrixa\Otp\ChatrixaOtpClient;
$client = new ChatrixaOtpClient('https://chatrixa.com', 'YOUR_API_TOKEN');
$sent = $client->send('+14155552671', ['expires_in' => 300]);
$check = $client->verify('+14155552671', $_POST['code']);
if (!empty($check['verified'])) {
// phone confirmed
}
Laravel
use Chatrixa\OtpLaravel\Facades\ChatrixaOtp;
ChatrixaOtp::send('+14155552671');
if (ChatrixaOtp::verify('+14155552671', $request->input('code'))) {
// phone confirmed
}
Configure with CHATRIXA_URL and CHATRIXA_API_TOKEN in .env
(publish the config with php artisan vendor:publish --tag=chatrixa-config).
Node.js
const { ChatrixaOtp } = require('chatrixa-otp');
const otp = new ChatrixaOtp({ baseUrl: 'https://chatrixa.com', token: process.env.CHATRIXA_API_TOKEN });
await otp.send('+14155552671', { expiresIn: 300 });
const check = await otp.verify('+14155552671', submittedCode);
if (check.verified) {
// phone confirmed
}
Python
from chatrixa_otp import ChatrixaOtp
otp = ChatrixaOtp("https://chatrixa.com", "YOUR_API_TOKEN")
otp.send("+14155552671", expires_in=300)
result = otp.verify("+14155552671", submitted_code)
if result["verified"]:
... # phone confirmed
Other stacks
The API is plain JSON over HTTPS โ see the OTP guide for the raw requests, or the API Reference for the full schema.