Open source · Self-hosted · Rust + React

The open-source backend for AI products

Multi-tenant auth, billing, payments, credits, and an admin console, already wired together. Self-host it and every tenant's records sit in your own Postgres. Hand the repo to your AI coding tool instead of a blank starter.

terminal
$git clone https://github.com/timzaak/herald.git
$cd herald
$uv run scripts/demo-start.py
→ Starting PostgreSQL + Redis ...
✓ Database migrated
✓ Multi-tenant auth (RBAC, OAuth, OIDC, TOTP)
✓ Billing & payments (Stripe, Creem, WeChat Pay)
✓ Credits, quotas & usage ledgers
✓ Admin console @ http://localhost:3000

What you get

Identity, payments, entitlements, and usage live in one codebase. Wiring like "a purchase grants credits, a refund revokes them" is code you can read and change.

Multi-tenant auth

Isolated realms, each with its own users, roles, apps, and branding.

  • Email/password and one-time-code login
  • Google, GitHub, Apple, WeChat, Discord, LDAP
  • Passkeys, TOTP 2FA, OpenID Connect

RBAC, orgs & client apps

Realm-level roles, organizations with their own membership, and app registration with scoped credentials.

  • Per-realm roles and org tiers
  • Client App registration
  • OAuth 2.0, device flow, cross-app SSO

Billing & payments

Subscriptions, one-time purchases, and invoices, mapped to entitlements per client app.

  • Stripe, Creem (merchant of record), WeChat Pay
  • App Store / Google Play in-app purchases
  • Multi-currency pricing & invoices

Points & credits

Prepaid balances that meter product usage, per user.

  • Top-ups, refunds, expiry
  • Per-user ledgers & grants
  • Rolling quota windows

Consent & compliance

Versioned terms and privacy policies per realm, hosted or external.

  • Version-bound re-consent
  • Hosted or external pages
  • Auditable account deletion

MCP server for AI agents

Agents query your realm through permission-gated tools instead of hand-written REST calls.

  • Nine read-only tools
  • Browser OAuth + per-user RBAC
  • Streamable HTTP at /mcp/{realmId}

From repository to AI product in three steps

Deploy the foundation, shape it with AI, build your product logic.

01

Deploy with Docker

Copy the deploy files from docker/deploy/, edit three configs, and run docker compose up -d. Herald, PostgreSQL, and Redis start on one machine; add Caddy when you want HTTPS.

02

Shape it with AI

Point an AI coding tool at the repo. The docs ship as llms.txt, the API as OpenAPI, and an MCP server exposes admin tools, so the agent works from real interfaces instead of guesses.

03

Build your product logic

Your app integrates through the Node, Rust, and browser SDKs and OAuth 2.0 endpoints, then keeps iterating on the experience customers pay for.

Herald vs. the alternatives

Auth services stop at login. The table shows what else ships in the same Herald codebase.

HeraldAuth0SupabaseKeycloak
Multi-tenant auth
Included
Enterprise onlyManual setupIncluded
Subscription billing
Built-in
NoNoNo
Points & credits
Built-in
NoNoNo
Self-hosted
Yes
Cloud serviceYesYes
Open source
Apache-2.0
NoPartialApache-2.0

Frequently asked questions

What people usually ask before starting.

What is Herald?
An open-source, self-hosted backend for AI products. One Apache-2.0 codebase ships multi-tenant auth, RBAC, billing, payments, credits, and an admin console, and you keep adapting it with AI coding tools.
How does Herald help me build faster?
The product itself takes days with AI tools; the parts users never see take weeks. Instead of stitching an auth provider, a payment provider, and a billing service, you start with those systems connected. When each provider has its own user IDs and webhooks, one dropped webhook can lock out a paying customer; in Herald those connections are one codebase.
How is Herald different from an auth provider?
An auth provider stops at identity. Herald also handles subscriptions, one-time payments, entitlements, credits, invoices, and tenant administration, so paid access and product usage share one foundation.
When is a hosted service the better choice?
If you only need login plus card payments and don't mind per-user pricing, a hosted auth service is less work. Herald pays off when you want tenant-level control, credit-based pricing, or user data in your own database.
What does multi-tenant mean in Herald?
Herald organizes your users and data into isolated realms. Each realm is a separate tenant with its own users, OAuth providers, client apps, and billing plans. Data between realms is fully isolated.
How do I deploy Herald?
Docker Compose runs three containers: the Herald app, PostgreSQL, and Redis. You need a Linux server (Ubuntu 22.04+, 2GB RAM), Docker Engine 24+, and a domain. Add Caddy as a reverse proxy when you want HTTPS; it fetches and renews certificates automatically.
What payment providers does Herald support?
Stripe, Creem, and WeChat Pay, plus App Store and Google Play in-app purchases. Creem acts as merchant of record and handles tax compliance. You create plans, map them to providers, and assign them to client apps.
What tech stack does Herald use?
Herald uses Rust (Axum framework) for the backend API and React with TypeScript for the frontend. Data is stored in PostgreSQL with SeaORM, and Redis handles sessions and caching.
Is Herald free and open source?
Yes. Herald is released under the Apache-2.0 license. You can use, modify, and distribute it freely, including for commercial projects, with no per-user license fee.
Can I get help evaluating or deploying Herald?
Yes. Email zsy.evan@gmail.com and tell us about your product; we can help with deployment, payment-provider setup, and architecture questions. Bugs and feature requests can go to the GitHub issue tracker.

Build the AI product users pay for

Create a realm on the live demo and look around first, or clone the repo and run it yourself. Apache-2.0, no per-user fee, user data in your own database.

Questions, or building something with Herald? Email us: zsy.evan@gmail.com