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
Long-running methods set their own per-call timeout, so you do not need to raise timeoutMs for them: emails.generate and emails.edit wait up to 240 seconds, emails.import and content.gif 300, and content.generateImage 180. A longer client timeoutMs is kept, and a per-request timeoutMs always wins. On Node, the built-in fetch stops waiting after 300 seconds whatever timeoutMs says.

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.