You focus on building your product - From Hello World to IPO. We handle payments, billing, and compliance.
Anyhive is an open-source, developer-first Merchant of Record (MoR) and billing layer. With Anyhive, you can build your own checkout and customer portals with hosted UI or embeddable components within minutes.
Open-source billing — pricing, metering, and compliance made simple.
- Server‑first access control: RSC/SSR‑friendly paywall with one‑line gating (
paywall().render) or explicitfetchIfAllowed. - Metered billing for tools & AI: quotas, rate limits, overage prompts, and guided upgrades.
- Compliance from day one: Tax/VAT/GST/JCT ready, with region‑specific modules on the roadmap.
- Open, portable, and programmable: Your data, your PSPs, your rules.
Anyhive is open-source Merchant of Record (MoR) with payments, subscriptions, and compliance. 100% open-source, 100% portable, 100% programmable.
It includes:
- A React SDK for embedding pricing tables, checkout, and customer portals.
- A Next.js hosted checkout page and customer portal.
- A CLI for installing and managing your pricing plans, subscriptions, and configuration.
- A comprehensive documentation and examples.
- An Admin dashboard for managing your pricing plans, subscriptions, and configuration.
With the admin dashboard, you can manage:
- 📊 Subscriptions & usage-based pricing
- ✅ Global tax, fraud, and compliance
- 🔑 Entitlement management & content delivery
- 🖥️ Embeddable checkout and customer portals
With one SDK + API + CLI + starter templates, developers can own your cross-border payments infra, e.g. collect payments, tax compliance and payouts in minutes, not weeks — without vendor lock-in.
We ship fast and iterate quickly.
V0.0.1: This week, we will focus on the following:
- The first release of Anyhive with a sandbox environment with API for pricing plans.
- The first release of useAnyhive hook for React.
- The first release of Anyhive CLI.
- 2 demo examples go live: usage meter and paywalled content.
V0.0.2: Next week, we will focus on the following:
- Hosted checkout page and customer portal.
Near-term
- Paywall SDK for content sites: RSC/SSR-first with minimal code changes (
fetchIfAllowed,paywall().render). - Metered billing for tools/AI: quotas, rate limits, overage prompts, upgrade flows.
- Default modern UI themes (Minimal, Neobrutal) with data-attributes/class hooks for customization.
- Frictionless developer onboarding: polished Next.js/React Router examples, quickstart CLI.
- By default, Anyhive will use Stripe as the default PSP since it is the most widely used and supported PSP.
Mid-term
- Usage tracking & event pipeline: metering signals, quota policies, billing reconciliation.
- Pricing & plan tooling: Pricing Table, upgrade/downgrade/grace workflows.
- Extensibility plugins: LLM API routing, usage analytics, A/B testing, dynamic pricing.
- PSP baseline integrations: Stripe/PayPal first, then regional providers (PayPay, LINE Pay, Momo…).
Long-term
- PSP-agnostic payment layer: avoid vendor lock-in, abstract capability/risk switching across PSPs.
- Tax & compliance: VAT/GST/JCT modules and filing workflows.
- Globalization: localized payment experiences, regulatory compliance, regionalized billing/tax rules.
We believe founders, startups, and businesses should focus on product, not payments and tax compliance.
Anyhive will become the global abstraction layer for payments and compliance — PSP‑agnostic, tax‑aware, and programmable — so teams can ship, scale, and switch providers without fear. Think Stripe-like developer experience, but available for every country’s PSP and tax system.
-
Zero‑friction integration: Keep your code. Add a few lines to gate content or track usage.
-
No lock‑in: Swap PSPs, export data, and evolve pricing without rewrites.
-
Production‑grade UX: Modern defaults (Minimal, Neobrutal) with simple theming or full control via data‑attributes.
-
📦 Merchant of Record Layer → We handle compliance and payouts for you.
-
💳 Billing Support → One-time, recurring subscriptions, and usage-based billing.
-
🌍 Tax Compliance → Integrated with Stripe Tax, Anrok, and direct modules in specific countries.
-
🛠 Open Source SDKs → TypeScript-first, with adapters for each PSP.
-
🖥️ Hosted checkout & customer portals (zero-setup)
-
⚛️ React components for embeddable, customizable UI
-
🧩 Unified Payments API → Integrate multiple PSPs (Stripe, PayPal, LINE Pay, Momo, etc.)
Anyhive allows you to:
- Manage and display checkout and customer portals with hosted UI or embeddable components.
- No-code upgrades, downgrades, and cancellation.
- Deal with cross-border payments and tax compliance in one place.
- Use Anyhive to build your own checkout and customer portals.
import { useAnyhive } from "@anyhive/core"
const { charge } = useAnyhive()
// One-time payment (e.g. LINE Pay in Thailand)
await charge({
amount: 1000,
currency: "THB",
method: "linepay",
customer: { id: "cus_123" },
})import { useAnyhive } from "@anyhive/core"
const { createCustomer } = useAnyhive()
// Create a customer
const customer = await createCustomer({
name: "John Doe",
email: "john.doe@example.com",
})
const { createSubscription } = useAnyhive()
// Create a subscription
const subscription = await createSubscription({
customerId: customer.id,
planId: "plan_123",
})Minimal integration with server-first gating. Two styles are supported: a one-liner helper and a manual pattern.
// app/page.tsx
import { prisma } from "@/lib/prisma";
import { paywall } from "@anyhive/react/server";
import "@anyhive/react/styles.css"; // optional defaults; or import a theme:
// import "@anyhive/react/themes/minimal.css";
export default async function Page() {
const { render } = await paywall(() => prisma.posts.findMany());
return (
<section>
<h2>Posts</h2>
{render((posts) => (
<ul>
{posts.map((p) => (
<li key={p.id}>
<strong>{p.title}</strong>
<div>{p.content}</div>
</li>
))}
</ul>
))}
</section>
);
}// app/page.tsx
import { prisma } from "@/lib/prisma";
import { anyhive } from "anyhive"; // server facade
import { PaywallOverlay, EmptyPlaceholder, AccessBanner } from "@anyhive/react/client";
export default async function Page() {
const { fetchIfAllowed, status } = anyhive.authorize();
const { allowed, data } = await fetchIfAllowed(() => prisma.posts.findMany());
return (
<section>
<h2>Posts</h2>
<AccessBanner status={status} />
{!allowed ? (
<PaywallOverlay href="/pricing">
<ul>
<li><strong>Post title example</strong><div>Post preview content…</div></li>
<li><strong>Post title example</strong><div>Post preview content…</div></li>
</ul>
</PaywallOverlay>
) : data.length === 0 ? (
<EmptyPlaceholder />
) : (
<ul>
{data.map((p: { id: number; title: string; content: string }) => (
<li key={p.id}>
<strong>{p.title}</strong>
<div>{p.content}</div>
</li>
))}
</ul>
)}
</section>
);
}The Anyhive CLI helps you initialize projects and set up a local development environment.
The CLI is included in this monorepo. In a standalone setup it can be installed globally:
npm i -g anyhive--env <sandbox|production>: Select target environment for commands--sandbox: Alias of--env sandbox
Environment resolution priority:
- CLI flags (
--envor--sandbox) - Environment variable
ANYHIVE_MODE - Default:
production
Initialize an Anyhive project configuration.
anyhive init --workspace <id> --token <installToken> [--dir <path>] [--force] [--env sandbox|production]Notes:
- Creates
anyhive.config.jsonin the target directory - Respects
--envto set the initialmodefield (e.g.sandboxorproduction)
Verify your installation (demo output).
anyhive verify [--env sandbox|production]Display the current user and environment (demo output).
anyhive whoami [--env sandbox|production]Create or update a local .env with a sandbox publishable key for local testing.
anyhive sandbox [--dir <path>] [--key <publishableKey>] [--force] [--write-all]Options:
--dir <path>: Directory for the.envfile (default: current directory)--key <publishableKey>: Provide a specific key instead of generating one--force: Overwrite existingANYHIVE_PUBLISHABLE_KEYin.env--write-all: Also upsert the following variables:ANYHIVE_MODE=sandboxANYHIVE_API_BASE_URL=https://sandbox.api.anyhive.devANYHIVE_WORKSPACE_ID=ws_sandbox_demo
Examples:
anyhive init --workspace ws_123 --token it_456 --env sandbox
anyhive verify --env sandbox
anyhive sandbox --dir . --write-all- Ruby on Rails
- PlanetScale - database(PostgreSQL)
- React - Embeddable components like pricing table, checkout, and customer portal.
- Next.js - Hosted checkout page & customer portal
- React Router - Hosted checkout page & customer portal
- Tailwind CSS - CSS
- Upstash - Redis
- Drizzle ORM - Database ORM
- Turborepo - Monorepo
- Cloudflare Workers - Serverless functions
- Vercel - Deployment
Anyhive is open-source and self-hostable. Our goal is to make it easy to self-host and you won't be locked-in, and to make it easy to integrate with your own payment service provider.
For the self-hosted version, we will make it easy to deploy to Cloudflare Workers or Vercel.
- ⭐ Star this repo
- 💬 Join the community on Discord
- 🛠 Try the SDK, open issues, and contribute PSP adapters