Skip to content

Python SDK — air-sdk

Server SDK for the AIR partner API (stdlib-only): HMAC webhook verification + typed events.

  • Repo: https://github.com/Glowar-Ltd/air-sdk-py
  • Runnable example: examples/fastapi_app.py in that repo.
from air_sdk import handle_webhook

result = handle_webhook(
    raw_body=raw,                  # raw request body (str)
    signing_secret=signing_secret,
    signature_header=request.headers.get("x-air-signature", ""),
)
if not result.ok:
    return Response(result.reason, status_code=result.status)
event = result.envelope            # typed envelope: event.type + event.data