Packages
Choose the protocol, server, React, and SQL layers your application needs.
The four packages version together but keep runtime boundaries separate. Most
React applications use server, db, and react.
Published on npm, still before 1.0.0. A release may change the API.
| Package | Responsibility |
|---|---|
@dimah-survey/core | Protocol types, browser clients, schemas, and store contracts |
@dimah-survey/server | Handlers, guards, validation, and runtime adapters |
@dimah-survey/react | SurveyJS Model and Creator bindings |
@dimah-survey/db | FumaDB-backed SQL store and schema references |
npm i @dimah-survey/server @dimah-survey/db @dimah-survey/react survey-core survey-react-uiDatabase installs fumadb and adds the tables to Drizzle,
Prisma, or Kysely. Install survey-creator-core and survey-creator-react
when you render Creator.
@dimah-survey/server
Backend integration:
dimahSurvey()for fill and editor instancesmemoryAdapter()for a process-local storeguardRespondent()andguardAnonymous()for fill guardscheckSurveyResult()for submit validationclearSurveyResult()for partial-save sanitization- adapters for Next.js, Node, Express, Hono, Fastify, Elysia, and SvelteKit
Browser bundles should import clients from react or core, not server.
@dimah-survey/react
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 clients, route constants, Zod schemas, stable error codes, 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.
memoryAdapter() keeps rows in the process for tests. @dimah-survey/db is
the SQL store. Implement SurveyStore when those tables cannot live in your
database. See Database.
Continue with Configuration or the HTTP protocol.