Packages
Choose the protocol, server, React, and SQL layers your application needs.
The four packages version together but keep runtime boundaries separate. A
typical React application installs server and react, then adds db for the
bundled SQL store.
Published on npm, still before 1.0.0. A release may change the API.
| Package | Install when you need | Does not own |
|---|---|---|
@dimah-survey/core | Protocol types, clients, schemas, errors, or a custom store | SurveyJS runtime |
@dimah-survey/server | Handlers, guards, validation, adapters, and local memory | UI or SQL ORM |
@dimah-survey/react | Model and Creator lifecycle bindings | SurveyJS renderers |
@dimah-survey/db | FumaDB-backed SQL storage and schema references | Your migrations |
npm i @dimah-survey/server @dimah-survey/react survey-core survey-react-uiAdd @dimah-survey/db fumadb for the bundled SQL store. Install
survey-creator-core and survey-creator-react only when your application
renders Creator.
@dimah-survey/server
Start here for backend integration:
dimahSurvey()for fill and editor instancesguardRespondent()andguardAnonymous()for fill guardsmemoryAdapter()for local development and testscheckSurveyResult()andclearSurveyResult()for validation behavior- adapters for Next.js, Node, Express, Hono, Fastify, Elysia, and SvelteKit
The package re-exports common error and client utilities for server
convenience. Browser bundles should import clients from react or core.
@dimah-survey/react
Use this in React client code:
useSurveyResponse()andbindSurveyModel()for fill sessionsuseSurveyDraft()andbindSurveyCreator()for Creator autosaveisStaleUpdate()for write-state handlingcreateFillClient()andcreateEditorClient()fromcore
It requires React and survey-core as peers. Your application imports
survey-react-ui and survey-creator-react, constructs their objects, and
renders their components.
@dimah-survey/core
Use core for non-React clients, shared protocol code, or custom stores. It
contains the fill/editor clients, route constants, Zod schemas, stable error
codes, list and settings helpers, and SurveyStore types.
Most applications use createFillClient() or createEditorClient(). Reach
for createSurveyFetch() only when you need the lower-level better-fetch
surface.
@dimah-survey/db
db(client) adapts a FumaDB client to SurveyStore. DimahSurveyDB describes
the versioned schema; Drizzle, SQL, and Prisma exports are readable reference
files.
Copy or generate those schema references into your application, then migrate the application-owned file. Do not import a reference schema into a running application.
The database package is optional. Any store must preserve immutable response definitions, compare-and-swap inside writes, and one open draft per identified respondent.
Continue with Configuration for runtime options or HTTP protocol for the operation map.