surge-sdk on PyPI and supports Python 3.9 and newer.
This page covers installing the package, sending your first request with both clients, paginating list endpoints, handling typed errors, and verifying webhook signatures in your handler.
Install and authenticate
AsyncSurge:
Your first request
Send a message:AsyncSurge:
Pagination
The SDK returns auto-paginating iterators for list endpoints. You don’t need to manage cursors manually:Retries and timeouts
The SDK retries transient failures (network errors, 5xx responses) with exponential backoff. Default: 3 retries. Configure retries and timeout on the client:Error handling
Errors raise typed exceptions:Webhooks
Verify webhook signatures and parse events:Webhook class follows the Standard Webhooks spec and handles replay protection automatically.