Last updated:
The technical semantics of the common Formcentric keys are described in the main Client (General).
This page therefore focuses on the SDK syntax, the behaviour of mount() and the SDK-specific options.
The first parameter for mount() is the target element.
The following are supported:
'#my-form'HTMLElementThe target element must be present in the browser DOM, if mount() is called.
The common semantics for these fields are described in Client (General).
In the SDK, the corresponding keys are as follows:
| SDK-Key |
embedId |
formDefinition |
srcUrl |
dataUrl |
designUrl |
The npm SDK uses the runtime included in @formcentric/client and does not accept formappUrl; untyped values passed to it are ignored with a warning. Runtime URLs for formcentric.js are described in Runtime & Delivery.
The common semantics for these fields are described in Formcentric Client General.
In the SDK, the corresponding keys are as follows:
| SDK-Key |
themeUrl |
themeVariableUrl |
themeVariables |
templateUrl |
themeDir |
theme |
skipThemeLoad |
skipTemplatesLoad |
skipFormLoad |
The common semantics for these fields are described in Client (General).
In the SDK, the corresponding keys are as follows:
| SDK-Key |
vars |
params |
refs |
token |
requestHeaders |
formName |
instanceId |
env |
configuration |
The common semantics of language, locale and translations are described in Client (General).
In the SDK, the corresponding keys are language, locale and localesPath.
Example:
Bundled SDK integrations can alternatively pass a locales object directly. This is the recommended approach if you want to provide date-fns and upload locale objects, including their functions.
The following snippet illustrates the structure; add the required Formcentric translations under resources. The rules for existing and new languages can be found in Client (General) under Configuration → Including your own translations.
The common semantics of maxWidth, height and debug are described in Client (General).
Example:
The technical semantics of parentUrl are described in Client (General). In the SDK, the same common key is used directly as parentUrl.
Example:
If parentUrl is not set explicitly, the current page URL is used as a user return context.
The SDK supports the following mount configuration fields:
embedId or formDefinition must be set.data-fc-* attributes on the target element are not used as a live configuration source.conflictBehavior with direct SDK mounts is 'throw'.embedId is required, then conflictBehavior: 'stop-existing' should be set.skipThemeLoad and skipTemplatesLoad take effect only if they are set explicitly.vars, params, themeVariables, and configuration should be passed as serializable objects. locales is the exception: it contains date-fns and upload locale objects, including their functions, and is passed by reference.data-fc-watch is Static-only and is ignored for SDK mounts.