QuickstartEstimated time: ~3 minutes

Getting Started with SentryRelay

Sentry Relay provides production-grade, zero-retention 2FA, OTP, Magic-Link, and TOTP vault infrastructure for unattended AI agents, browser automation (Browserbase, Stagehand, Browser Use, Playwright), and multi-client RPA agencies. Intercept out-of-band challenges in under 200ms without human approval prompts or exposing sensitive mailboxes.

Using an AI Coding Agent? Point Claude Code, Cursor, or Antigravity directly to /llms.txt, /llms-full.txt, or install the Agent Skill at /skills/sentryrelay/SKILL.md.
1

Install the CLI, SDK, or MCP Server

Choose your preferred integration surface. The srelay CLI provides immediate interactive testing, while the TypeScript and Python SDKs plug directly into Playwright, Stagehand, or Browser Use scripts.

pnpm add @sentryrelay/sdk
# Or install the official srelay CLI globally:
npm install -g sentryrelay
2

Obtain your API Key

Create an API key in the Developer Console → API Keys. Keys are prefixed with sr_live_ or sr_test_ and hashed using SHA-256 with zero plaintext key persistence. You can also scope a key to specific client Identities (scopedIdentityIds) for multi-tenant isolation.

Set environment variable:
export SENTRY_RELAY_API_KEY="sr_live_948f2b7a..."
3

Create an Identity & Intercept 2FA

Each Identity receives a dedicated email address (slug@in.sentryrelay.com), an optional dedicated US carrier SMS phone number (DID), and an envelope-encrypted TOTP vault. Use the long-polling wait primitive to cleanly pause your agent until the fresh code or magic link arrives.

import { SentryRelay } from '@sentryrelay/sdk';
import { test, expect } from '@playwright/test';

const relay = new SentryRelay({
  apiKey: process.env.SENTRY_RELAY_API_KEY!,
});

test('Automated login with OTP 2FA', async ({ page }) => {
  // 1. Trigger login form
  await page.goto('https://app.target.com/login');
  await page.fill('input[type="email"]', 'staging-agent@in.sentryrelay.com');
  await page.click('button[type="submit"]');

  // 2. Wait up to 30s for the 2FA code (resolves in <200ms of arrival)
  const auth = await relay.wait('staging-agent', {
    channel: 'email',
    sender: 'target.com',
    timeout: 30,
  });

  console.log('Received OTP:', auth.event?.otpCode, 'in', auth.waitDurationMs, 'ms');

  // 3. Fill verification code & verify authenticated state
  await page.fill('input[name="otp"]', auth.event!.otpCode!);
  await page.click('button#verify');
  await expect(page).toHaveURL('/dashboard');
});
Sub-200ms Latency

Multiplexed Redis pub/sub push notifications and a 15-second lookback ZSET awaken long-polling agent workers instantly without race conditions.

Zero Raw Retention

Inbound payloads undergo immediate deterministic extraction in volatile RAM; raw bodies are never written to persistent disk.

Burn-After-Read

OTPs and magic links are claimed atomically via Redis Lua scripts and can be purged the microsecond your agent retrieves them.

Looking for AI Agent MCP integration?

Connect Claude Code, Cursor, or OpenClaw using the native Model Context Protocol (MCP) server (6 canonical tools over stdio & Streamable HTTP).

View MCP Setup