Authentication
The client authenticates with your developer API key.
Environment variable (recommended)
import os
from sendafrica import SendAfrica
client = SendAfrica() # reads SENDAFRICA_API_KEYExplicit key
client = SendAfrica(api_key="SA-...")Client options
from sendafrica import SendAfrica
client = SendAfrica(
api_key="SA-...", # or omit to read SENDAFRICA_API_KEY
base_url="https://api.sendafrica.online/v1",
timeout=10, # request timeout in seconds
max_retries=3, # retry on 429 / 5xx / network errors
debug=True, # prints request/response summaries
webhook_secret="whsec_...", # used by client.webhooks for signature verification
)Keep credentials server-side
Never embed the API key in browser JavaScript, mobile app bundles, or public repositories. Use separate keys per environment and rotate immediately after exposure.
Last updated on