Zindua
PHP SDK · v1.0.0

Zindua for PHP

Laravel, Symfony, WordPress custom, cron scripts. Send OTP email and WhatsApp with zindua/sdk — same API as Node.

composer require zindua/sdk

Server-side only

ZINDUA_API_KEY in .env or getenv(). Never expose in the browser or mobile app.

Typed validation

Email, E.164 WhatsApp, template slugs validated locally before calling the API.

Email + WhatsApp

One send() method for both channels. Same templates as Node and WordPress.

Zero HTTP deps

Uses PHP ext-curl and ext-json only. No Guzzle required.

Laravel ready

Register Client as a singleton. Inject in controllers, jobs, and notifications.

CLI companion

Test sends with @zindua/cli before wiring PHP code.

Quick start

Install and send

Three steps from composer require to your first OTP.

composer require zindua/sdk

# .env
ZINDUA_API_KEY=znd_test_your_key_here

Email OTP

<?php
use Zindua\Client;

$zindua = new Client(['apiKey' => getenv('ZINDUA_API_KEY')]);

$result = $zindua->send([
    'to' => 'user@example.com',
    'template' => 'otp-verification',
    'lang' => 'fr',
    'variables' => ['code' => '482910', 'appName' => 'MyShop'],
]);

echo $result['logId'];

WhatsApp OTP

$zindua->send([
    'to' => '+243812345678',
    'channel' => 'whatsapp',
    'template' => 'otp-verification',
    'variables' => ['code' => '482910'],
]);
Setup

Step by step

Step 01

Create a Zindua project

Sign up at zindua.run, create a project, copy the API key. Connect email and/or WhatsApp in the dashboard.

Step 02

Install the SDK

composer require zindua/sdk in your Laravel, Symfony, or WordPress custom project.

Step 03

Send from PHP

new Client(['apiKey' => getenv('ZINDUA_API_KEY')]) then send() with template slug and variables.

Step 04

Test with CLI

npx @zindua/cli@latest doctor and send — smoke test before deploying PHP code.

API

Methods

Parity with @zindua/sdk TypeScript.

MethodEndpointDescription
send()POST /sendQueue email or WhatsApp message
getProject()GET /projectProject, plan, channel status
getTemplates()GET /templatesSynced slugs, langs, variables
connect()POST /connectBind API key to site URL
Integrations

Laravel and WordPress

// config/zindua.php
return ['api_key' => env('ZINDUA_API_KEY')];

// AppServiceProvider
$this->app->singleton(Client::class, fn () => new Client([
    'apiKey' => config('zindua.api_key'),
]));
// mu-plugins/zindua-otp.php
require_once ABSPATH . 'vendor/autoload.php';

$zindua = new \Zindua\Client([
    'apiKey' => getenv('ZINDUA_API_KEY'),
]);
Environment

Variables

VariableRequiredExampleNotes
ZINDUA_API_KEYYesznd_test_xxxxxxxxxxxxxxxxxxxxxxxxFrom Dashboard → Projects
ZINDUA_API_BASE_URLNohttps://zindua.run/api/v1Optional API override
ZINDUA_SITE_URLNohttps://myshop.comFor bound keys (WordPress connect)

Test first with the CLI

Smoke test your API key before writing PHP code.

npx @zindua/cli@latest doctor

WordPress without code?

Use the official zindua-connect plugin for OTP login and contact forms.