Skip to main content

Install

npm install @brew.new/sdk

Package

PropertyValue
Package@brew.new/sdk
RuntimeNode 20 or newer
Repogithub.com/GetBrew/typescript-sdk
The SDK is server-first. Do not use it directly in browser code with a real API key.

Create A Client

import { createBrewClient } from '@brew.new/sdk'

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

Configuration

The client accepts these options:
import { createBrewClient } from '@brew.new/sdk'

const brew = createBrewClient({
  apiKey: process.env.BREW_API_KEY!,
  baseUrl: 'https://brew.new/api',
  timeoutMs: 30_000,
  maxRetries: 2,
  userAgent: 'my-app/1.0.0',
  fetch: globalThis.fetch,
})

Common baseUrl values

  • https://brew.new/api
  • https://staging.brew.new/api
  • http://localhost:3000/api

First Request

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

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 analyze documentation with ChatGPT or Claude for deeper insights.