Configuration

Configure application-specific networking and translations outside the portable schema.

A complete configuration

TypeScript
const config = {
  apis: {
    backend: {
      baseUrl: 'https://api.example.com/v1/',
      headers: (context) => ({ Authorization: 'Bearer ' + getToken() }),
      credentials: 'same-origin',
      timeoutMs: 30000,
    },
  },
  i18n: {
    translations: { en: '/locales/en.json', sk: '/locales/sk.json' },
    fallbackLanguage: 'en',
    // Alternatively supply directory: '/locales'.
  },
  // Optional: request: yourRequestExecutor
}

API settings

PropertyMeaning / default
apisNamed API definitions referenced by data sources and file uploads. No APIs are configured by default.
baseUrlRequired HTTP(S) base path, without embedded credentials, query, or fragment.
headersOptional HeadersInit or synchronous/asynchronous function of request context. Evaluated per request.
credentialsFetch credentials policy; defaults to omit.
timeoutMsPositive finite timeout, default 30,000 ms. Includes request execution and aborts on expiry.
requestOptional executor override for the shared API layer. Receives a normalized request and returns a data envelope.

Endpoint definitions use a relative endpoint beneath their API base path and optionally a method. Absolute URLs and path escapes are rejected. Data-source requests default to GET; uploads default to POST. Put credentials in config or your request override, never in an exported schema.

Translation settings

PropertyMeaning / default
i18n.translationsA map of language to imported JSON catalog or browser-accessible JSON URL.
i18n.directoryAlternative catalog directory URL. Loads the language.json file.
i18n.fallbackLanguageFallback catalog language; defaults to en. Bundled English remains the final system-text fallback.
languageA per-form/editor prop, not global config. Defaults to inherited language or en.

Translation loading uses the request executor with context.operation = 'i18n', without inheriting application API headers or credentials. Literal schema strings use lookup and fallback. See Localization for plural forms, parameters, loading failures, and reload.

Form instance props

PropPurpose
schemaRequired Tungsten schema (schemaVersion: sprout).
onSubmitRequired callback for validated meaningful values; may return a Promise.
initialValuesOptional value object or null for schema/type defaults.
config / dataSourcesAPI/translation configuration and named data-source definitions.
designOptional Tungsten, Bootstrap or custom design; defaults to Tungsten.
languagePer-instance presentation language.
colorSchemeLight or dark; inherits TungstenThemeProvider, otherwise light. Theme changes preserve form state.
colorProfileNamed CSS palette; inherits TungstenThemeProvider, otherwise sprout. Custom names require application CSS.
onStateChangeCompleted schema/state/values/valid snapshot callback, including invalid data.
onReadyReceives the controller for reset, value loading and file preparation.
TSX
const config = {
  maxProcessingSteps: 100, // Increase for intentionally broad cascades.
  warnings: 'console',    // 'silent' mutes warning logs, not callback delivery.
}
<Tungsten schema={schema} config={config}
  onDiagnostic={({ severity, messageKey, params, message }) => {
    console.log(severity, messageKey, params, message)
  }}
  onReady={controller => { /* controller.reset() restores initial values */ }} />

Configuration boundaries

Configure autosave and submission endpoints, or handle their promises in your application. Angular, material and custom display formats remain future work.