Skip to main content

Overview

Brew currently ships an official TypeScript SDK for the public API. It is a thin, typed wrapper over the same /api/v1 endpoints documented in the API reference. The SDK does not invent a second contract. It follows the OpenAPI source of truth.

Current SDK

SDKPackageInstall
TypeScript@brew.new/sdknpm install @brew.new/sdk

What You Get

  • Typed request and response shapes.
  • One client with resource methods like brew.contacts.upsert(...).
  • Automatic retries for safe retry cases.
  • Auto-generated idempotency keys on POST.
  • Typed BrewApiError handling for non-2xx responses.

Current TypeScript SDK Resources

  • audiences
  • brands
  • contacts
  • domains
  • emails
  • fields
  • sends
  • templates

SDK Or REST API

Use the SDK when you want:
  • Type safety.
  • Less HTTP boilerplate.
  • Built-in retries and idempotency support.
  • A resource-oriented client surface.
import { createBrewClient } from '@brew.new/sdk'

const brew = createBrewClient({
  apiKey: process.env.BREW_API_KEY!,
})

const { domains } = await brew.domains.list()

Suggested Reading Order

  1. Authentication
  2. TypeScript Installation
  3. TypeScript Quickstart
  4. API Reference

Need Help?

Our team is ready to support you at every step of your journey with Brew. Choose the option that works best for you:

Search Documentation

Type in the “Ask any question” search bar at the top left to instantly find relevant documentation pages.

ChatGPT/Claude Integration

Click “Open in ChatGPT” at the top right of any page to analyze documentation with ChatGPT or Claude for deeper insights.