Overview
Brew currently ships an official TypeScript SDK for the public API. It is a thin, typed wrapper over the same/api/v1 endpoints documented
in the API reference. The SDK does not invent a second contract. It
follows the OpenAPI source of truth.
Current SDK
| SDK | Package | Install |
|---|---|---|
| TypeScript | @brew.new/sdk | npm install @brew.new/sdk |
What You Get
- Typed request and response shapes.
- One client with resource methods like
brew.contacts.upsert(...). - Automatic retries for safe retry cases.
- Auto-generated idempotency keys on
POST. - Typed
BrewApiErrorhandling for non-2xx responses.
Current TypeScript SDK Resources
The TypeScript SDK exposes every public v1 resource:| Resource | Methods | Notes |
|---|---|---|
brew.triggers | create, list, get, patch, delete | Deterministic create (brew_api provider hardcoded server-side). patch is metadata-only; triggers don’t have a status field — gate firing via automation.published. |
brew.emails | generate, edit, list | emailType (campaign | automation | transactional) is required on generate. |
brew.automations | create, list, get, patch, publish, unpublish, delete | Deterministic graph; every sendEmail node pins emailVersionId. |
brew.automationRuns | fire, test, replay, list, get, cancel | Returns { runs: [...] } envelope on every list/get. |
brew.sends | create | Campaign-only — audienceId required. |
brew.contacts | upsert, list, get, patch, delete | Single or batch (≤ 1000) on upsert / delete. |
brew.fields | list, create, delete | Custom contact fields. |
brew.audiences | list | Read-only listing of saved audiences. |
brew.domains | list | Read-only listing of verified sending domains. |
brew.templates | list | Org-wide public template catalog (the only non-brand-scoped resource). |
brew.events | fire | Deprecated alias for brew.automationRuns.fire. |
templates automatically scopes to that brand. Create and manage
keys at brew.new/settings/api. See
the API introduction’s Brand Scoping section
for the full breakdown.
Other Languages
The TypeScript SDK is the only one Brew currently ships as a typed, versioned wrapper. For Python / Go / Ruby / Java / PHP / Swift / Kotlin / .NET, generate a client from the canonical OpenAPI 3.1 spec — see Generate your own SDK for the recommended generators and one-command scaffolds. The spec lives at:https://brew.new/openapi/public-api-v1.yaml— served from the API hosthttps://docs.brew.new/api-reference/openapi-public-v1.yaml— served from this docs site
curl / httpx / fetch — see the cURL examples on every
generated Public API v1 endpoint page.
SDK Or REST API
- Use the SDK
- Use REST directly
Use the SDK when you want:
- Type safety.
- Less HTTP boilerplate.
- Built-in retries and idempotency support.
- A resource-oriented client surface.
Suggested Reading Order
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:- Self-Service Tools
- Talk to Our Team
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.