SDK
Use our official libraries to integrate AxeDz into your app quickly. They handle authentication, retries, and error messages so you can focus on your product.
Available languages
Official SDKs are available for Node.js and Python. SDKs for PHP and other languages are coming soon — you can always use the REST API directly in the meantime.
Node.js
Installation
bash
npm install axedzSet up your client
Node.js
const AxeDz = require("axedz"); const client = new AxeDz(process.env.AXEDZ_API_KEY);Send an SMS
Node.js
const sms = await client.sms.send({ to: "+213555123456", message: "Your OTP is 482910",}); console.log(sms.id, sms.status);Send an email
Node.js
const email = await client.email.send({ to: "user@example.com", subject: "Password reset", body: "<p>Click the link to reset your password.</p>",}); console.log(email.id, email.status);Check your balance
Node.js
const wallet = await client.wallet.get();console.log(wallet.balance, wallet.currency); // balance in DZDPython
Installation
bash
pip install axedzSet up your client
Python
from axedz import AxeDzimport os client = AxeDz(os.environ["AXEDZ_API_KEY"])Send an SMS
Python
sms = client.sms.send( to="+213555123456", message="Your OTP is 482910",) print(sms.id, sms.status)Send an email
Python
email = client.email.send( to="user@example.com", subject="Password reset", body="<p>Click the link to reset your password.</p>",) print(email.id, email.status)Handling errors
When a request fails, the SDK throws a clear error so you know exactly what went wrong and how to fix it:
- ValidationError — something is wrong with your request (e.g. invalid phone number)
- AuthorizationError — your API key is missing, invalid, or revoked
- NotFoundError — the resource you requested does not exist
Node.js
try { await client.sms.send({ to: "invalid", message: "Hi" });} catch (err) { if (err.code === "ValidationError") { console.error(err.message); }}