SendAfrica logoSendAfricaDocs

SDKs Overview

Official SendAfrica SDKs for Python, TypeScript, C#, PHP, C++, and Dart — shared conventions, feature matrix, and choosing the right one.


Official SDKs wrap the REST API in idiomatic language constructs. They all share the same core behavior, so code written against one feels familiar in another:

  • Typed responses — every method returns a typed model (SMSResult, CreditBalance, …).
  • Automatic retries on 429/5xx with exponential backoff (min(0.5 × 2^(attempt−1), 8.0) s, max 3).
  • Local phone normalization to E.164 before any network call.
  • Request tracing — every request carries a unique X-Request-Id UUID.
  • Webhook helpers — HMAC-SHA256 signature verification built in where supported.
  • 1:1 endpoint mapping — every method corresponds to a route in the API reference.

#Feature matrix

SDKInstallRequiresStatusBulkWebhook sigAsyncIdempotency
Pythonpip install sendafricaPython 3.9+stableYesYesYesYes
TypeScriptnpm install sendafricaNode 18+stableYesYes
C# (.NET)dotnet add package SendAfrica.NET 8 / Std 2.0stableYesYesYes
PHPcomposer require sendafrica/sendafricaPHP 7.4+stableYesYes
C++conan install sendafrica/1.0.1C++17, CMake 3.16+stableYesYes
Dartpub (coming soon)Dart 3+betaYes

#The same quickstart in every language

quickstart.py
python
from sendafrica import SendAfrica

client = SendAfrica(api_key="SA-xxxxx")

result = client.sms.send(
    to="0712345678",
    message="Welcome to SendAfrica",
)
print(result.message_id, result.status, result.credits_used)

Key resolution is uniform

Every SDK resolves your API key in the same order: explicit argument → SENDAFRICA_API_KEY environment variable → typed auth error. Set the env var once and construct clients with zero arguments in development.

Sender ID naming across surfaces

The approved sender ID is called from in REST/JSON bodies, sender in Python & TypeScript SDK arguments, and sender_id in campaign payloads and Agent tools. All three refer to the same value (max 11 characters). Omit it to send from the platform default SendAfrika — custom values must be registered and authorized, otherwise the carrier rejects them and your message goes out under the platform fallback sender instead. See Sender IDs.