Introduction
Brew provides official SDKs for TypeScript and Python that make it easy to integrate email marketing capabilities into your applications. The SDKs provide type-safe interfaces, automatic retries, and comprehensive error handling.TypeScript SDK
Full TypeScript support with type definitions for all requests and responses.
Python SDK
Both synchronous and asynchronous clients with Pydantic models.
Available SDKs
Features
Both SDKs include:- Type Safety - Full type definitions for all API requests and responses
- Automatic Retries - Built-in retry logic with exponential backoff for transient failures
- Error Handling - Structured error types for different failure scenarios
- Configurable Timeouts - Control request timeouts at the client or request level
- Logging - Debug logging for troubleshooting API calls
- Rate Limit Handling - Automatic retry on rate limit errors (429)
Rate Limits
Brew enforces 10 requests per second per account. Both SDKs automatically handle rate limiting by:- Retrying rate-limited requests with exponential backoff
- Respecting
Retry-Afterheaders from the server
SDK vs REST API
- When to Use SDKs
- When to Use REST API
Use the official SDKs when you want:
- Type safety - Get compile-time errors and autocomplete in your IDE
- Less boilerplate - No need to handle HTTP requests, headers, or JSON parsing
- Automatic retries - Built-in handling for rate limits and transient errors
- Easier upgrades - SDK updates handle API changes for you
Quick Comparison
- TypeScript
- Python
- Python (Async)
Requirements
TypeScript SDK
- TypeScript >= 4.9
- Node.js 20 LTS or later
- Also supports: Deno, Bun, Cloudflare Workers, Vercel Edge Runtime
Python SDK
- Python >= 3.9
- Works with both synchronous and asynchronous code
Getting Started
1
Get your API key
In Brew, go to Settings → API and click Generate Key.
2
Install the SDK
Choose your language and install the package:
3
Set up authentication
Set your API key as an environment variable:
4
Start building
Follow the quickstart guide for your SDK:
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.