Skip to content

ScrawnDotDev/Scrawn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

397 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Scrawn Backend

Scrawn is a self-hostable usage-based billing backend that replaces 60+ lines of billing boilerplate with a single function call. It ingests billable events, evaluates your pricing logic, and hooks into Dodo Payments for collection — no cron jobs, no manual gRPC plumbing.

Built on Bun, Fastify, gRPC, and PostgreSQL / ClickHouse.

Prerequisites

Quick Start

The Scrawn CLI automates the entire local stack — just run:

bunx scrawn@latest init
bunx scrawn@latest start

This generates the docker-compose config and starts PostgreSQL, ClickHouse, the gRPC server, and the dashboard — all in the background.

Stop & Reset

bunx scrawn@latest stop    # Graceful stop, preserves data
bunx scrawn@latest reset   # Wipes all data volumes

SDK Integration

import { scrawn } from "@scrawn/core";

const biller = scrawn({
  apiKey: process.env.SCRAWN_KEY,
  baseURL: process.env.SCRAWN_BASE_URL,
  httpUrl: process.env.SCRAWN_HTTP_URL,
});

// Track usage in one line
await biller.basicUsageEventConsumer({
  userId: "cus_123",
  debit: 4500,
});

Docs

Complete API reference and integration guides: scrawn.vercel.app/docs

License

MIT

About

Billing infrastructure - Integrate usage-based billing with a single function

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages