One token
AI · storage · email
Zero key pasting

Using Your Stack

Set one env var. Run one command. Every service Brokr provisioned — AI, storage, email, database — is ready to use. No API keys to paste, no dashboards to visit.

Providers

Every capability Brokr provisions is backed by a best-in-class provider. Brokr manages the accounts, credentials, and wiring — you never sign up for these directly or paste their API keys.

GitHub
Repos & CI/CDBrokr-managed
Vercel
Deployment & hostingBrokr-managed
Neon
Postgres databaseBrokr-managed
Cloudflare R2
Object storageBrokr-managed
Resend
Email sendingBrokr-managed
Brokr AI Gateway
AI — Claude, GPT, and moreBrokr-managed

When you run brokr create from a directory with an existing GitHub remote, Brokr attaches infrastructure around your repo instead of creating a new one. Your repo stays in your GitHub account — Brokr manages everything else.

Local Dev Setup

One step: run brokr create. Everything is written to .env automatically — no dashboard visits, no copy-pasting.

bash
brokr create web-app --name my-app
# ✓ Stack created → clxxxxxxxxxxxxx
# ✓ .env.brokr → BROKR_TOKEN + secrets written
# Provisioning: https://my-app.brokr.sh

Then install the SDK and create one file:

bash
npm install @brokr/sdk
bash
// lib/brokr.ts ← create this once
import { createBrokr } from '@brokr/sdk';
export const brokr = createBrokr();

BROKR_TOKEN authenticates all three services — AI, storage, and email all go through api.brokr.sh. The gateway resolves the per-stack config server-side. You never touch RESEND_API_KEY or provider keys directly.

The TypeScript SDK is available now. Python and Go SDKs are also written — npm publish is the final step.

Env Reference

What ends up in your .env.brokr and why. This file is the source of truth for all stack env vars — brokr deploy reads from it, and it seeds your .env for local dev.

VariableNeeded byWhat it is
BROKR_TOKENSDKGateway auth — AI, storage, and email. Written to .env.brokr by brokr create.
DATABASE_URLDB clientPostgres connection string. Written to .env.brokr by brokr create. Read by Prisma, Drizzle, etc.
APP_URLoptionalYour app's public URL. Useful for OAuth callbacks and email links. Written to .env.brokr by brokr create.

RESEND_API_KEY and EMAIL_FROM_DOMAIN are stored inside Brokr and used by the gateway internally. They never appear in your .env.brokr — you never touch them.

AI

brokr.ai.chat() sends messages to api.brokr.sh/v1/chat/completions — an OpenAI-compatible endpoint. You can also point the official openai npm package at brokr.ai.baseURL and use every SDK feature: streaming, function calling, structured output. The gateway supports multiple providers — Claude, GPT-4o, Deepseek, and more.

bash
import { brokr } from '@/lib/brokr';
const reply = await brokr.ai.chat([
{ role: 'user', content: 'Summarize this contract in 3 bullet points.' },
]);
console.log(reply.content);
// "Sure! Here are the key points: ..."

Storage

Files live in Brokr-managed Cloudflare R2 under your stack prefix. The SDK gets presigned URLs from the gateway — your code never touches R2 credentials. upload() is the easiest path: one call, fully transparent. getUploadUrl() gives you the URL for browser uploads or large files.

bash
import { brokr } from '@/lib/brokr';
// Gets a presigned URL and PUTs for you — one call.
const { key } = await brokr.storage.upload(
fileBuffer, // Buffer | Uint8Array | string | Blob
'invoice.pdf',
'application/pdf',
);
// Store key in your DB. Use it to get download URLs later.

Store the key in your database. Presigned download URLs expire (~15 min) — generate them on demand, never store them.

Email

brokr.email.send() routes through the gateway with your BROKR_TOKEN. Brokr resolves the from address and Resend key server-side — you never configure either locally. The from address defaults to noreply@{your stack domain}.

bash
import { brokr } from '@/lib/brokr';
await brokr.email.send({
to: 'user@example.com',
subject: 'Welcome to MyApp!',
html: `<p>Hi ${name}, you're in.</p>`,
// from defaults to noreply@{your stack domain} — no config needed
});

Domain

Every stack gets a {name}.brokr.sh subdomain automatically. Attach a custom domain with --domain when creating a stack — Brokr registers it, wires DNS via Cloudflare, and verifies email sending through Resend.

bash
# Search availability first
brokr search domains --name smooth
# Create a stack with a custom domain in one step
brokr create web-app --name smooth --domain smooth.app
# ✓ Stack created → clxxxxxxxxxxxxx
# ✓ .env.brokr → BROKR_TOKEN + secrets written
# Provisioning: https://smooth.brokr.sh (live immediately)
# Pending: https://smooth.app (DNS propagating, 24-48h)

Your {name}.brokr.sh subdomain is live immediately after provisioning. The custom domain typically resolves within 24-48 hours as DNS propagates globally. Email sending from your domain activates after Resend verifies the DNS records, which usually takes under a few minutes after DNS is live.

When a custom domain is configured, EMAIL_FROM_DOMAIN is set to your domain automatically. Emails sent via brokr.email.send() will come from noreply@smooth.app without any extra configuration.

Domain purchase requires a Brokr account (brokr link account). Domain management currently routes through Namecheap for registration and Cloudflare for DNS.

Database

No SDK wrapper. DATABASE_URL is a Neon Postgres connection string written to your .env by brokr create. Use whatever client you want.

bash
// DATABASE_URL is written to .env.brokr by brokr create.
// Prisma reads it from .env — no additional setup.
import { PrismaClient } from '@prisma/client';
export const db = new PrismaClient();

Complete Example

AI + database + email. Eleven lines of actual logic.

bash
import { brokr } from '@/lib/brokr';
import { db } from '@/lib/db';
async function handleUserMessage(userId: string, message: string) {
// 1. Ask AI
const reply = await brokr.ai.chat([{ role: 'user', content: message }]);
// 2. Persist to DB
await db.message.create({ data: { userId, content: reply.content } });
// 3. Email the user
const user = await db.user.findUniqueOrThrow({ where: { id: userId } });
await brokr.email.send({
to: user.email,
subject: 'Your reply is ready',
html: `<p>${reply.content}</p>`,
});
return reply;
}
// Next.js server action. Express route handler. Hono handler. All identical.

Works identically in Next.js server actions, Express routes, Hono handlers, and plain Node scripts. The brokr client uses standard fetch — no runtime-specific code.