zindua/sdk
Composer 安装命令:
composer require zindua/sdk
包简介
Official Zindua SDK for PHP — transactional email and WhatsApp via POST /api/v1/send.
README 文档
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_KEYstays on the server only- Validation runs locally before calling the API (same rules as
@zindua/sdkTypeScript) - 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 |
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-11