Zindua

Zindua for PHP

Laravel, Symfony, WordPress custom, cron scripts. Send OTP email and WhatsApp with zindua/sdk v1.1.0. 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

Pick a use case — the PHP snippet updates. Composer to first OTP.

terminal
composer require zindua/sdk # .envZINDUA_API_KEY=znd_test_your_key_here
Setup

Step by 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.

02

Install the SDK

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

03

Send from PHP

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

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.