Skip to main content
Configure retries, timeouts, pagination, and logging to fit your integration. This page covers all SDK options beyond the defaults.

Error handling

The SDK throws typed errors for every HTTP status code. Catch them to handle specific failure modes:
Each HTTP status code maps to a typed error class: In Go, every API error shares the type *rainsdk.Error. Switch on apierr.StatusCode to branch on the HTTP status.

Retries

By default, the SDK retries connection errors, 408, 409, 429, and 5xx responses up to 2 times with exponential backoff.

Timeouts

Requests time out after 60 seconds by default. The SDK retries timed-out requests.
The Go SDK does not apply a default request timeout. Always pass a context.Context with a deadline appropriate for your workload — option.WithRequestTimeout only governs each individual attempt.

Pagination

List endpoints use cursor-based pagination. Pass cursor and limit to page through results:
In Go, List returns *[]T — dereference the pointer to iterate. The cursor parameter is param.Opt[string]; import the helper from github.com/SignifyHQ/rain-sdk-go/packages/param and use rainsdk.String(...) to set it.

Logging

Control SDK log output with the RAIN_LOG environment variable or the logLevel client option:
The Go SDK exposes a single debug toggle — pass option.WithDebugLog(nil) to log to stderr, or any *log.Logger to direct output elsewhere. There are no log levels.
Debug logging may expose sensitive request and response data. Only use debug level in development.

Idempotency

Pass an Idempotency-Key header to safely retry write operations without duplicate side effects:
See Idempotency for how Rain processes idempotent requests.

What’s next

Card Issuance

Issue your first card end-to-end with the SDK.

Transaction Monitoring

List, filter, and manage transactions.

Funding & Transfers

Fund cards with collateral deposits.