SDK API Reference
This directory contains the public API reference for @mercura-aps/frontend-form-sdk.
The SDK exposes a single global store composed of substores, each responsible for a specific domain. All substores are accessed directly from the store instance.
Substores
| Substore | Description |
|---|---|
| addons-substore | Lazy-fetched addon resources keyed by registry entry |
| appearance-substore | Lazy-fetched appearance configuration resources |
| auth-substore | Authenticated user state |
| configs-substore | Configuration lifecycle — add, remove, update, reorder, copy |
| contact-details-substore | Contact form fields — fixed (name/email) and dynamic request fields |
| finished-configs-substore | Read-only view of all completed configurations with their selections |
| form-categories-substore | Category tree navigation and filtering strategies |
| form-substore | Per-config form state — steps, navigation, constraints, prices |
| forms-substore | Paginated forms list with search and category filtering |
| localization-substore | Language and country selection |
| number-formatter-substore | Price and number formatting utilities |
| options-substore | Lazy-fetched option resources keyed by registry entry |
| reset-substore | Full store reset with configurable lifecycle callbacks |
| submit-substore | Form submission, draft save/load, and request copy restore |
| values-substore | Per-config selected values and option quantities |
Core types
ApiResource<T>
Returned by all lazy-fetched data properties.
type ApiResource<T, E = Error> = { data: T | undefined; isLoading: boolean; error: E | undefined | null;};TConfig
Represents a single user configuration in the session.
type TConfig = { id: number; name: string; formId: number; formName: string; status: "in-progress" | "completed" | "incomplete"; configQuantity: number; missingRequiredElements: TMissingRequiredElement[];};TValues / TQuantities
type TValues = Record<string, string[]>; // elementId → selected option IDs/valuestype TQuantities = Record<string, Record<string, number>>; // elementId → optionId → quantity