Skip to content
@ScrawnDotDev

Scrawn

The End-to-End Billing Infrastructure for the Builders.

Welcome to Scrawn

Scrawn is a billing infrastructure that lets you integrate usage-based billing into your application with a single function call.

Track billable events, calculate usage, and handle payments - all with one line of code.

What is Scrawn?

Scrawn tracks user events, calculates usage, and handles payments - all behind a simple SDK. Instead of building billing logic yourself, you call event consumers and we handle the rest.

import { Scrawn } from '@scrawn/sdk';

const scrawn = new Scrawn({
  apiKey: process.env.SCRAWN_KEY!,
  baseUrl: process.env.SCRAWN_BASE_URL!
});

// That's it - track usage with one line
await scrawn.sdkCallEventConsumer({ 
  userId: 'uuid', 
  debitAmount: 69.69,
});

One line of code - That's all you need to start tracking billable events in your application.

Why Scrawn?

No complex billing logic. One function call tracks events, calculates usage, and triggers payments. Charge users based on actual consumption. Track API calls and function invocations per user. Monitor events, manage API keys, and view analytics out of the box.

How It Works

  1. Deploy Backend - Self-host the gRPC server with PostgreSQL
  2. Install SDK - Add @scrawn/sdk to your application
  3. Track Events - Call scrawn.sdkCallEventConsumer() whenever billable actions occur
  4. Collect Payment - Call scrawn.collectPayment() when usage exceeds threshold

Getting Started

Get running in under 2 minutes with our quick start guide. Learn how to integrate Scrawn into your application

Use Cases

  • API Platforms - Charge per API request
  • AI Services - Bill based on compute/tokens used
  • Data Processing - Track storage, bandwidth, or processing time
  • SaaS Products - Usage-based pricing for any metric

Features

  • Self-Hosted - Full control over your billing infrastructure
  • gRPC Backend - High-performance server with PostgreSQL
  • Type-Safe SDK - TypeScript SDK with full type safety
  • Framework Agnostic - Works with Express, Next.js, Fastify, tRPC, NestJS
  • Production Ready - LRU caching, retry logic, error handling

Scrawn is open source and available on GitHub.

Popular repositories Loading

  1. Scrawn Scrawn Public

    TypeScript 10 1

  2. Documentation Documentation Public

    TypeScript 5 1

  3. Scrawn.js Scrawn.js Public

    TypeScript 4 1

  4. Dashboard Dashboard Public

    TypeScript 4

  5. .github .github Public

Repositories

Showing 5 of 5 repositories

Top languages

TypeScript

Most used topics

Loading…