Skip to content
RelayDocumentation

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/sdk

Then create a client with your API key:

import { Relay } from "@relay/sdk";
 
const relay = new Relay(process.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

SDKMinimum versionNotes
Node.js20Also runs on Bun, Deno and edge runtimes
Python3.9Sync and async clients
Go1.22Context-aware, no dependencies
Ruby3.1Thread-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 login

Configuration

Every SDK accepts the same options:

apiKeystringrequired

Your secret API key. Test keys start with rk_test_, live keys with rk_live_.

timeoutnumberdefault: 30000

Request timeout in milliseconds.

maxRetriesnumberdefault: 2

How many times to retry network errors and 5xx responses. Requests that create resources are only retried when you pass an idempotency key.

baseUrlstringdefault: https://api.relay.dev

Override the API host, for example to use a proxy.