Install and configure
Install zindua from PyPI and keep ZINDUA_API_KEY in your process environment or secrets manager. Use znd_test_ in staging and znd_live_ only in production.
The Python client validates key format and channel destinations locally so common mistakes fail before the network call.
pip install zindua
# .env
ZINDUA_API_KEY=znd_test_xxxxxxxxxxxxxxxxxxxxxxxxFastAPI send route
Expose a server-only endpoint that accepts email or phone, then calls client.send with your template slug. Never ship the project key to the browser.
from fastapi import FastAPI
from zindua import Zindua
import os
app = FastAPI()
client = Zindua(api_key=os.environ["ZINDUA_API_KEY"])
@app.post("/auth/otp")
async def send_otp(email: str):
await client.send(
to=email,
template="otp-verification",
channel="email",
variables={"code": "123456", "appName": "Acme"},
)
return {"ok": True}WhatsApp and email parity
Switch channel without a second SDK. Keep template slugs shared across stacks so Node, Python, and .NET apps render the same OTP copy.
Before go-live, run CLI doctor and confirm the email connector or WhatsApp number is ready on the project.
- Server-only API key
- Stable template slug per intent
- Lang fallback via project default
- Doctor green before deploy