Skip to main content

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 a Bearer token header for you.

Get Your API Key

1

Open Settings

In Brew, go to Settings → API.
2

Create a key

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

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.