Skip to main content

Install

Package

The SDK is server-first. Do not use it directly in browser code with a real API key.

Create a Client

Generate an API key for the active brand at brew.new/settings/api. Each key is bound to that brand, and the SDK resolves it automatically. See API authentication for the complete scoping and permission contract.

Configuration

The client accepts these options:

Common baseUrl Values

  • https://brew.new/api
  • https://staging.brew.new/api
  • http://localhost:3000/api
Email generation (brew.emails.generate) takes 30-90 seconds. Set timeoutMs to at least 240_000 (4 minutes) if your workflow generates emails. The default 30-second timeout will cause generation calls to fail.

First Request

Quickstart

Walk through contacts, templates, emails, and sends.

Error Handling

See how BrewApiError works.

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 explore it further with ChatGPT or Claude.