@reintersect/sdk is one package with several entry points. Import only the ones you use, because
each is tree-shaken separately. Effect is an optional peer dependency, so install effect and
@effect/platform only if you import an Effect entry point.
reintersect) is a bin in the same package, and it loads the
optional peer dependencies esbuild and miniflare for build and dev.
Entry points
@reintersect/sdk
@reintersect/sdk/app
The composed app has
.addBlock, .addReference, .addEvent, .addCommand, .addMessageAction,
.addRoute, .addMcp(handler, { auth }) and fetch(request, env?, ctx?).
@reintersect/sdk/components
The catalog components, listed on the catalog overview, plus
the rich text components for Prose and Text. Inline code is InlineCode here, because Code is
the code block component.
@reintersect/sdk/recipes and @reintersect/sdk/effect/recipes
The factories approval, poll, rsvp, checklist, deployment, incident, ticket and
metricsPanel, plus each recipe’s view component, schemas, labels and helpers. See
Recipes.
@reintersect/sdk/mcp
To mount an MCP server on your app, call
.addMcp on the app. See MCP servers.
@reintersect/sdk/testing and @reintersect/sdk/effect/testing
createTestHost(app, options?) on the Promise entry; makeTestHost(app, options?) and
ReintersectTestHost (a service with ReintersectTestHost.layer(app, options?)) on the Effect entry.
Both export textOf, findNodes, buttonsOf, buttonOf, treeFor, checkTree, expectTree,
testViewer, TEST_SIGNING_SECRET, TREE_LIMITS and the test error classes. See
Testing.
@reintersect/sdk/effect and @reintersect/sdk/effect/app
/effect exports the Effect member API client (Reintersect, ReintersectClient), the app client
ReintersectAppClient.make(app, options), renderPayload and ReintersectStream.
/effect/app exports createReintersectApp, defineBlock, defineAction, defineReference,
defineEvent, defineCommand, defineMessageAction, defineRoute, choice, secret, provide, manifestOf,
toNodeHandler, the ReintersectApp namespace (ReintersectApp.layer) and the app error classes.
See the Effect guide.
JSX configuration
Blocks and documents use the automatic JSX transform with the SDK as the import source. Set it once intsconfig.json:
tsconfig.json
Effect. You can
also set the import source per file:
<div> is a type error, because blocks are built only from the
catalog. Components may return JSX, a Promise of JSX, or, on the Effect entry, an Effect of JSX.
Schemas
Props, state, action args, action input, install config and environment values all take a schema. On the non-Effect entry points, a schema must implement both Standard Schema V1 and Standard JSON Schema V1. Reintersect validates values, and it also needs JSON Schema for forms, agent tools and the manifest.State schemas must not transform
Reintersect stores block state as JSON and Standard Schema has no encode step, so a state schema’s input and output types must be the same. A transform such as parsing a string into aDate is a
type error: