Skip to main content
Surge has official SDKs for Python, TypeScript, Ruby, and Elixir. Each SDK wraps the REST API with language-native types, pagination helpers, retry logic, error handling, and webhook signature verification. The four SDK pages are organized the same way: install and authenticate, send your first request, paginate, handle errors, and verify webhooks. Pick the SDK that matches your stack:

Python

pip install surge-sdk. Sync and async clients.

TypeScript

npm install @surgeapi/node. Full TypeScript types.

Ruby

gem "surge_api". Sorbet types included.

Elixir

{:surge_api, "~> 0.2"}. Phoenix WebhookPlug and WebhookHandler.

Authentication

All SDKs read the API key from the SURGE_API_KEY environment variable by default. You can also pass it directly to the client constructor.

Account scoping

All account-scoped SDK methods take the account_id as a parameter (or first positional argument). This maps to the account ID in the request path.

Making requests not covered by an explicit function

Every SDK exposes a raw HTTP method for endpoints that don’t have a dedicated SDK function. For example, new endpoints in beta or private APIs.
Use this escape hatch when you need to call an endpoint before the SDK has a typed method for it. You get full request/response types from the SDK client but no IDE autocompletion on the response body.