GuidesGet started
Installation
Install a Relay SDK for your language, or the CLI for local testing.
Relay has official SDKs for Node.js, Python, Go and Ruby. They wrap the REST API, verify signatures and retry network errors for you. You can also call the API directly with any HTTP client.
SDKs
npm install @relay/sdkpip install relay-sdkgo get github.com/your-org/relay-gogem install relay-sdkThen create a client with your API key:
import { Relay } from "@relay/sdk";
const relay = new Relay(process.env.RELAY_API_KEY);import os
from relay import Relay
relay = Relay(api_key=os.environ["RELAY_API_KEY"])client := relay.NewClient(os.Getenv("RELAY_API_KEY"))relay = Relay::Client.new(api_key: ENV["RELAY_API_KEY"])The language tabs on this page stay in sync. Pick one and every code sample in the docs follows your choice, even after you reload.
Requirements
| SDK | Minimum version | Notes |
|---|---|---|
| Node.js | 20 | Also runs on Bun, Deno and edge runtimes |
| Python | 3.9 | Sync and async clients |
| Go | 1.22 | Context-aware, no dependencies |
| Ruby | 3.1 | Thread-safe client |
CLI
The Relay CLI forwards events to your machine and replays past deliveries. See Test locally with the CLI.
brew install relay-cli
relay loginConfiguration
Every SDK accepts the same options:
Your secret API key. Test keys start with rk_test_, live keys with rk_live_.
Request timeout in milliseconds.
How many times to retry network errors and 5xx responses. Requests that create resources are only retried when you pass an idempotency key.
Override the API host, for example to use a proxy.