Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.brew.new/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The Brew SDK uses the same API keys as the raw REST API. Every request is authenticated with your Brew API key. The SDK sends it as Authorization: Bearer brew_your_api_key for you. The server also accepts the alternate X-API-Key: brew_your_api_key header for raw HTTP callers, but the SDK standardizes on Bearer to keep one canonical wire format. Each API key is bound to exactly one brand at creation time, so the SDK never asks you to pass a brandId for any endpoint. The Brew API does not accept brandId anywhere in a request body or query — sending one returns 400 INVALID_REQUEST. To act on a different brand, switch brands in the dashboard and create a new key. See the API introduction for the full breakdown of brand-scoped vs. organization-wide endpoints and the permission scopes (contacts, emails, all) each route requires.

Get Your API Key

1

Open the API settings page

2

Pick the brand

Make sure the brand active in the dashboard is the one you want this key to act on. Each key is permanently bound to one brand at creation; you cannot retarget it later.
3

Create a key

Create a new API key and copy it somewhere safe.
4

Store it in your environment

Keep it server-side. Do not commit it or expose it in frontend code.
Use an environment variable in your own app code:
export BREW_API_KEY="brew_your_api_key"
Then create the SDK client with that value:
import { createBrewClient } from '@brew.new/sdk'

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

Validate The Key

Use a simple read call to make sure the key works:
const { domains } = await brew.domains.list()
console.log(domains)

Security Notes

  • Keep API keys on the server only.
  • Use different keys for development and production.
  • Rotate keys if you think one was exposed.
  • Log the x-request-id from failed calls when debugging.

Next Steps

TypeScript Installation

Install and configure @brew.new/sdk.

API Introduction

See the raw public API contract.

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.