Skip to main content
The Ruby SDK ships with Sorbet type signatures for every endpoint, so editors and srb tc can flag bad payloads before runtime. It’s published as surge_api on RubyGems and supports Ruby 3.1 and newer. This page covers installing the gem, sending your first request, paginating list endpoints, rescuing typed errors, and verifying webhook signatures inside a Rails controller.

Install and authenticate

Add to your Gemfile:
Gemfile
Set your API key:
Sorbet type signatures are included for typed Ruby projects.

Your first request

Pagination

The SDK provides an auto-paginating enumerator:
For manual pagination:

Retries and timeouts

Error handling

Webhooks