zindua/sdk

Official Zindua SDK for PHP — transactional email and WhatsApp via POST /api/v1/send.

Maintainers

Package info

github.com/bbasabana/zindua-php

Homepage

pkg:composer/zindua/sdk

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-07-11 08:43 UTC

This package is auto-updated.

Last update: 2026-07-11 19:51:09 UTC


README

Official server-side SDK for Zindua: send transactional email and WhatsApp messages with one API.

Full API reference zindua.run/developers
PHP product page zindua.run/php
Dashboard zindua.run/login
composer require zindua/sdk

Requirements: PHP 8.1+, ext-curl, ext-json. Run only on your server (never in the browser).

Quick start

1. Install

composer require zindua/sdk

2. Configure

# .env — never commit real keys
ZINDUA_API_KEY=znd_live_xxxxxxxxxxxxxxxxxxxxxxxx

3. Send OTP

<?php
require 'vendor/autoload.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:

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

Factory helper

use Zindua\ZinduaFactory;

$zindua = ZinduaFactory::client(); // reads ZINDUA_API_KEY from env

API surface

Method Endpoint Description
send() POST /send Queue email or WhatsApp message
getProject() GET /project Project, plan, channels
getTemplates() GET /templates Synced templates
connect() POST /connect Bind API key to site URL

Laravel

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

// AppServiceProvider
$this->app->singleton(Client::class, fn () => new Client([
    'apiKey' => config('zindua.api_key'),
]));

WordPress custom (mu-plugin)

require_once ABSPATH . 'vendor/autoload.php';

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

Security

  • ZINDUA_API_KEY stays on the server only
  • Validation runs locally before calling the API (same rules as @zindua/sdk TypeScript)
  • API key is never included in error messages

Related

Package Purpose
@zindua/sdk Node.js / TypeScript SDK
@zindua/cli Terminal tools
@zindua/create-app Next.js auth starter
zindua-connect Official WordPress plugin