Integrations
First-party companion packages that bridge a stitch to the framework, frontend, logger, and store you already run — each a thin layer over a stable seam, never a re-implementation.
A stitch is plain TypeScript with no framework and no node:*, so it already runs
anywhere. The packages here are the companions: thin bridges that wire a stitch
into the tool you already run — a backend framework, a frontend's reactivity, your
logger, your store — so its lifecycle, principal, streaming, and telemetry line up
with the host instead of being bolted on.
Each one is small on purpose. They plug into a handful of stable seams, so a new integration is ~100 lines over an existing contract, not a rewrite — and every companion is proven against the same conformance kits the core ships:
- Backend seam — lifecycle, request-scoped principal (
seam.as(user)), an SSE→response bridge, and an error→HTTP mapping, identical across frameworks. - Reactive store —
@stitchapi/query-coreowns a framework-agnosticsubscribe/getSnapshotstore; each frontend binding is a few lines against its own primitive. TraceSink— forward the typed event stream to the logger or telemetry pipeline you already run.StitchStore— move throttle counters, sessions, and cache into a shared backend so they go fleet-wide with no call-site change.
Backend frameworks
Attach a seam to your server: one shared client with a request-scoped principal,
an SSE helper, and an error bridge.
NestJS
A module + injectable seam, request-scoped principal, and an exception filter that maps StitchError to HTTP.
Fastify
A plugin with a request-scoped principal, SSE reply bridge, and an error handler — wired to Fastify's lifecycle and logger.
Hono
Edge/multi-runtime middleware with a per-request seam and an SSE bridge — Workers, Deno, Bun, Node.
Next.js
Web-standard route-handler helpers — sseResponse (text/event-stream) and stitchErrorResponse (StitchError → Response).
Frontend
Each binding is a thin layer over the shared @stitchapi/query-core store, so
updates are tearing-free and streaming-first — the view re-renders as each
delta chunk arrives, which plain request/response query libraries don't model.
One core, one binding per framework's own reactive primitive.
React
Tearing-free useStitch / useStitchStream hooks built on useSyncExternalStore.
Vue
useStitch / useStitchStream composables backed by Vue 3 reactivity (refs).
Svelte
stitchStore / stitchStreamStore — real Svelte stores, on Svelte 4 and 5.
Angular
injectStitch / injectStitchStream exposed as both signals and an RxJS observable.
TanStack Query
Use a stitch as a queryFn with the framework-agnostic queryOptions(stitch, input) helper — no hard dependency.
SWR
useStitchSWR runs a stitch as an SWR fetcher — SWR owns caching and revalidation.
RTK Query
stitchQueryFn / stitchStreamUpdater slot a stitch into an RTK Query endpoint (incl. streaming).
Observability
Pino
Forward the event stream to a Pino logger as structured, leveled records — metadata-only, safe on a secret-bearing seam.
Sentry
Map the event stream to Sentry breadcrumbs and capture error events with the call's context.
For OpenTelemetry, core exports an OTLP trace bridge directly — see the OTLP guide.
State & storage
Attach a StitchStore to move a stitch's throttle counters, sessions, and cache
into a shared backend — fleet-wide, with no call-site change.
Authentication
Core ships bearer / apiKey / basic / cookieSession / oauth2 built in; companions add the schemes that need more.
Agents & AI
A stitch is agent-native through the MCP surface; a companion adapts it to a specific framework's tool-calling loop.