Documentation Index
Fetch the complete documentation index at: https://docs.flowsbuilt.com/llms.txt
Use this file to discover all available pages before exploring further.
Requirements
- Node.js 18+ (or any edge runtime with Web Crypto API)
- TypeScript 5.0+ (optional but recommended)
Install
Set your API key
Add your key to your environment:.env
Basic setup
Next.js setup
Create a shared client file so you don’t instantiate on every request:lib/churnkit.ts
churn in your Server Actions, Route Handlers, or API routes:
app/api/checkout/route.ts
Cloudflare Workers / Edge
The SDK uses only Web-standard APIs (fetch, crypto.subtle) and works on Cloudflare Workers, Vercel Edge Functions, and Deno Deploy with no modifications:
worker.ts
Module formats
The package ships both ESM and CJS:| Format | Entry point |
|---|---|
| ESM | dist/index.mjs |
| CJS | dist/index.cjs |
| Types | dist/index.d.ts |
import and require both work out of the box.