Docs · SDK & client

SDK & client

For teams embedding Closure Forms, Experiences, and GraphQL inside an existing product — a standalone Next.js, React, Vue, Angular, or Node app that talks to Closure the same way partners do.

Building in Cursor / Claude Code / VS Code? See Build in your IDE — MCP is the agent craft path; this SDK is for runtime product embeds.

Packages

PackageRole
@closure-sdk/coreFramework-agnostic ClosureClient — GraphQL, Experiences, workflows, runs
@closure-sdk/reactClosureProvider, useExperience, useSubmitRun, and friends
@closure-sdk/nextApp Router BFF: createClosureBffHandlers for /api/closure/*
pnpm add @closure-sdk/core @closure-sdk/react @closure-sdk/next

Vue / Angular: use @closure-sdk/core from your composition or services layer today; framework wrappers can land later without changing the HTTP contract.

Two connection modes

ModeWhenPaths
`bff` (default)Your host owns /api/closure/* and proxies with server credentials/api/closure/graph, /api/closure/workflows/:id, /api/closure/runs/submit, …
`platform`Browser or server talks to the console directly (same-origin, or API key)/api/graphql, /api/experience/:slug, /api/workflows/:id, /api/runs/submit, …

Never put vault secrets in the browser. Prefer bff for product hosts — your frontend talks to your own routes, and credentials stay server-side (see Auth & API keys).

Quick start (Next.js)

BFF routeapp/api/closure/[...path]/route.ts:

import { createClosureBffHandlers } from "@closure-sdk/next";

export const { GET, POST, PUT, PATCH, DELETE } = createClosureBffHandlers({
  platformUrl: process.env.CLOSURE_API_URL || "https://closureapps.com/console",
  // login or apiKey — server-side env only
});

Client component:

"use client";
import { ClosureProvider } from "@closure-sdk/react";

export function App() {
  return (
    <ClosureProvider mode="bff">
      <ExperienceHost slug="my-console" />
    </ClosureProvider>
  );
}

Your app now renders a live Experience from the org graph, submits Forms into governed workflow runs, and reads product data over GraphQL — without owning any of the persistence, audit, or vault.

@closure-platform/client (monorepo)

Thin re-export of @closure-sdk/* plus ClosureRunForm (Forms + workflow seal). Prefer depending on @closure-sdk/* directly in new hosts.

Package map (Platform monorepo)

PackageRole
graphWorkflow Graph model
runtimeExecutor + durable runs
semanticProduct object store + GraphQL helpers
forms / forms-reactWeb form projection
experiences / experiences-reactUI graph + renderer
integrationsConnector catalog + adapters
knowledgeSkills + Files retrieve
mcp-serverIDE control plane (platform_* tools)
sdkFixtures + public barrels
clientRe-exports closure-sdk + Forms embed

Forms embed

Publish from Closure Workflows → Ship. Embed packaging mounts wizard or monolith into a host page — not a third form layout.