---
title: Packages
description: What ships together, and what each package owns.
---

The repo publishes four packages on one version line. They are released
together, and an internal dependency is always the workspace version.

| Package | What it is |
| --- | --- |
| [`@potion.run/paykit`](https://github.com/potion-run/paykit/tree/main/packages/paykit) | Billing and entitlement: catalog, model, store, providers |
| [`@potion.run/paykit-polar`](https://github.com/potion-run/paykit/tree/main/packages/paykit-polar) | Polar as a paykit provider |
| [`@potion.run/paykit-stripe`](https://github.com/potion-run/paykit/tree/main/packages/paykit-stripe) | Stripe as a paykit provider |
| [`@potion.run/paykit-admin`](https://github.com/potion-run/paykit/tree/main/packages/paykit-admin) | The Foldkit ops console over `BillingAdminApi` |

Each package's modules are in the reference: [Paykit](/reference/paykit),
[Paykit Polar](/reference/paykit-polar), [Paykit Stripe](/reference/paykit-stripe)
and [Paykit Admin](/reference/paykit-admin). A page there is one source module,
generated from the JSDoc beside it.

## What each one owns

`@potion.run/paykit` owns the model: the event log, the standing, the
entitlement read, the catalog guard, the policies and the provider port. A host
declares a catalog, builds a `BillingStack`, and calls the typed commands.

The provider packages own one vendor each. They create and reconcile the
products, prices and meters the catalog describes, and they decode the vendor's
webhooks. Money movement stays behind the `Payments` port.

The admin package is a client of `BillingAdminApi`. It never owns billing state:
the list, preview and verify are reads, and every write is a command with a
command id.

## Examples

- [Billing example](https://github.com/potion-run/paykit/tree/main/examples/billing) — the full Worker on D1: Api, console, MCP, checkouts, webhooks and a typed `Tenant` API over the catalog declarations.
- [Memory example](https://github.com/potion-run/paykit/tree/main/examples/memory) — the smallest deployment: `MemoryStore` and the manual provider, with no database or key.
- [Polar example](https://github.com/potion-run/paykit/tree/main/examples/polar) — `PolarBilling` provisions a product and hands its id to the Worker.
- [Stripe example](https://github.com/potion-run/paykit/tree/main/examples/stripe) — `StripeBilling` provisions the prices and meters, and the Worker resolves the lookup keys it was given.
- [Postgres example](https://github.com/potion-run/paykit/tree/main/examples/postgres) — the model on Postgres through Cloudflare Hyperdrive, with Alchemy's SQL client and migration registry.
- [Admin example](https://github.com/potion-run/paykit/tree/main/examples/admin) — the console, a cookie session and pushed live reads.
- [Auth example](https://github.com/potion-run/paykit/tree/main/examples/auth) — Better Auth on D1, and the provider-neutral session resolver.
- [TanStack example](https://github.com/potion-run/paykit/tree/main/examples/tanstack) — a TanStack Start app whose billing UI is the Effect Atom client.

:::tip[The design of record]
The decisions behind this model live in the
[ADRs](https://github.com/potion-run/paykit/tree/main/docs/adr) and
[AGENTS.md](https://github.com/potion-run/paykit/blob/main/AGENTS.md).
:::
