RavenRelayDocs
Dashboard ↗

API reference

Node.js SDK

Use the TypeScript workspace client for sending and reading email, and verifying webhook signatures.

Package availability

Create a client

TypeScript · workspace usage
import { RavenRelay } from '@ravenrelay/node';​const raven = new RavenRelay({  apiKey: process.env.RAVENRELAY_API_KEY!,  baseUrl: 'https://api-production-1c6a.up.railway.app',  timeoutMs: 10000,});​const accepted = await raven.emails.send({  from: 'hello@example.com',  to: 'user@example.net',  subject: 'Welcome',  text: 'Hello from RavenRelay',}, { idempotencyKey: 'welcome-user-123' });​const email = await raven.emails.get(accepted.id);const page = await raven.emails.list({ status: 'sent' });

Set baseUrl explicitly to your deployment. The client accepts a custom fetch implementation and request timeout. It throws RavenRelayError with status, code and message for API errors, and does not automatically retry sends.

RavenRelay documentation. Examples describe the current implementation.