Skip to main content

Current Client Surface

The TypeScript SDK is resource-oriented.
import { createBrewClient } from '@brew.new/sdk'

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

Resources And Methods

ResourceMethods
brew.audienceslist()
brew.brandslist(), create()
brew.contactslist(), count(), getByEmail(), upsert(), upsertMany(), patch(), delete(), deleteMany()
brew.domainslist()
brew.emailslist(), generate()
brew.fieldslist(), create(), delete()
brew.sendscreate()
brew.templateslist()

Common Flow

const { templates } = await brew.templates.list()
const { domains } = await brew.domains.list()

const generated = await brew.emails.generate({
  prompt: 'Create a welcome email',
  referenceEmailId: templates[0]?.emailId,
})

if ('emailId' in generated) {
  await brew.sends.create({
    emailId: generated.emailId,
    domainId: domains[0]!.domainId,
    subject: 'Welcome to Brew',
    emails: ['user@example.com'],
  })
}

Source Of Truth

The SDK follows the Brew OpenAPI contract. If you want the raw HTTP shape behind any method, use the API reference in this docs site.

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.