Entry points
The public DomainKit imports, what each entry point carries, where each one runs, and the runtime and peer versions they need to be installed with.
DomainKit publishes one core package with four entry points, an optional PostgreSQL persistence package, and a React package. These names are the public contract; internal source paths are not.
Install
npm install domainkit effect@^4pnpm add domainkit effect@^4yarn add domainkit effect@^4bun add domainkit effect@^4nub add domainkit effect@^4aube add domainkit effect@^4Add the React package when the product needs ready-made flows or UI parts:
npm install @domainkit/react react react-dompnpm add @domainkit/react react react-domyarn add @domainkit/react react react-dombun add @domainkit/react react react-domnub add @domainkit/react react react-domaube add @domainkit/react react react-domAdd the persistence package when the host runs Effect on PostgreSQL:
npm install @domainkit/capsuledb capsuledb @effect/sql-pgpnpm add @domainkit/capsuledb capsuledb @effect/sql-pgyarn add @domainkit/capsuledb capsuledb @effect/sql-pgbun add @domainkit/capsuledb capsuledb @effect/sql-pgnub add @domainkit/capsuledb capsuledb @effect/sql-pgaube add @domainkit/capsuledb capsuledb @effect/sql-pgEntry points
| Import | Carries |
|---|---|
domainkit |
Lifecycle services, host seams, providers, values, and DomainKit.Error |
domainkit/server |
Server.group, its layers, Server.Identity, and the wire schemas |
domainkit/client |
Transport.fromFetch and the Promise adapters |
domainkit/testing |
Fakes, the recording transport, and the conformance runners |
@domainkit/react |
The React flow hook, the controllers, the message catalog, and Testing |
@domainkit/capsuledb |
Storage on PostgreSQL as one CapsuleDB capsule |
domainkit/client runs in the browser and holds no credential. domainkit/server and
@domainkit/capsuledb run on the server and never reach browser code.
One subpath per namespace
The root re-exports every namespace, and each one is also its own subpath:
import { Plan, Principal } from "domainkit";
// or
import * as Plan from "domainkit/Plan";
import * as Principal from "domainkit/Principal";
The root import is the documented default and what every example on this site uses. Reach for a subpath in two cases:
- Your package emits declarations. A
.d.tsthat mentionsPrincipal.ServiceorPlan.Modelneeds a module path TypeScript can name.import("domainkit/Principal").Serviceresolves to one module, so the declaration your build emits is portable. - You want a narrow import. One namespace, without pulling the root’s names into scope.
Runtime and types resolve to the same module either way, so the two spellings never disagree.
| Subpath |
|---|
domainkit/Approval, /Cleanup, /Cloudflare, /Connect, /Custody, /DnsRecord |
domainkit/DomainKit, /DomainName, /Plan, /Principal, /Provider, /Providers |
domainkit/Provision, /Reason, /Receipt, /Resolver, /Storage, /Vercel, /Verify |
Nothing else is importable. There is no pattern export, and no path under internal or entry is
part of the contract.
Where each one runs
browser server
------- ------
@domainkit/react domainkit/server -> domainkit
-> domainkit/client --HTTP--> -> @domainkit/capsuledb
-> provider APIs
Runtime requirements
domainkitneeds Node.js 24.10 or newer and Effect 4 as a peer dependency.@domainkit/reactneeds React 19 and React DOM 19 beside those.@domainkit/capsuledbneedscapsuledband a host-ownedSqlClient.
Install domainkit and @domainkit/react at the same release version. The React package decodes
the core package’s schemas, so mixed versions can disagree about a shape.