Zindua

Zindua for .NET

ASP.NET Core, Azure App Service, Minimal APIs. Send OTP email and WhatsApp with Zindua.Sdk v1.0.1. Same API as Node, PHP, and Python.

dotnet add package Zindua.Sdk

Starter project

ASP.NET OTP example

Minimal API sample with email and WhatsApp OTP via Zindua.Sdk. Unzip, set your API key, run with dotnet run.

Download ZIP

Server-side only. Never put ZINDUA_API_KEY in Blazor WebAssembly, SPA, or mobile apps. Use ASP.NET Core API routes as a BFF.

Server-side only

ASP.NET Core, Azure App Service, Functions. Never put the API key in Blazor WASM.

Typed validation

Email, E.164 WhatsApp, and template slugs validated locally before the HTTP call.

Email + WhatsApp

One SendAsync for both channels. Same templates as Node, PHP, and Python.

Native HttpClient

IHttpClientFactory + Options pattern. No RestSharp required.

DI ready

services.AddZindua(configuration). Inject IZinduaClient anywhere.

CLI companion

Smoke-test with @zindua/cli before deploying .NET code.

Quick start

Install and send

Three steps from NuGet to your first OTP.

dotnet add package Zindua.Sdk

# appsettings.json or env
ZINDUA_API_KEY=znd_test_your_key_here

Email OTP (Minimal API)

using Zindua;
using Zindua.DependencyInjection;

builder.Services.AddZindua(builder.Configuration);

app.MapPost("/auth/otp", async (IZinduaClient zindua, OtpRequest req) =>
{
    var result = await zindua.SendAsync(new ZinduaSendOptions
    {
        To = req.Email,
        Template = "otp-verification",
        Lang = "en",
        Variables = new Dictionary<string, string>
        {
            ["code"] = req.Code,
            ["appName"] = "MyShop",
        },
    });
    return Results.Ok(new { result.LogId });
});

record OtpRequest(string Email, string Code);

WhatsApp OTP

await zindua.SendAsync(new ZinduaSendOptions
{
    To = "+243812345678",
    Channel = "whatsapp",
    Template = "otp-verification",
    Variables = new Dictionary<string, string> { ["code"] = "482910" },
});
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

dotnet add package Zindua.Sdk in your ASP.NET Core or worker project.

03

Register and send

builder.Services.AddZindua(builder.Configuration) then inject IZinduaClient and call SendAsync.

04

Deploy with secrets

Set ZINDUA_API_KEY in Azure App Settings or User Secrets. Never commit live keys.

API

Methods

Parity with @zindua/sdk TypeScript.

MethodEndpointDescription
SendAsync()POST /sendQueue email or WhatsApp message
GetProjectAsync()GET /projectProject, plan, channel status
GetTemplatesAsync()GET /templatesSynced slugs, langs, variables
GetLogAsync()GET /logs/{id}Delivery status for a logId
ConnectAsync()POST /connectBind API key to site URL
Integrations

DI and Azure

Dependency injection

// Program.cs
builder.Services.AddZindua(builder.Configuration);

// Or configure inline:
builder.Services.AddZindua(o =>
{
    o.ApiKey = builder.Configuration["Zindua:ApiKey"]!;
    o.TimeoutMs = 30_000;
});

Azure App Service

# Azure App Service: Application settings
ZINDUA_API_KEY=znd_live_xxxxxxxxxxxxxxxxxxxxxxxx

# Or Key Vault reference
ZINDUA_API_KEY=@Microsoft.KeyVault(SecretUri=https://.../secrets/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

Test first with the CLI

Smoke test your API key before deploying .NET code.

npx @zindua/cli@latest doctor

Prefer Node or PHP?

Same Zindua API. Pick the SDK that matches your stack.