SDK reference · Incode Web SDK 2 Reference / Web SDK 2 Individual Modules

Custom Fields Module

Note

This guide is specific to Web SDK 2.0. If you are still using 1.x, you can find documentation here. Contact your Incode Representative for upgrade information and check if you are a candidate for this upgrade.

Full rollout to all clients still TBD.

The Custom Fields module renders a form generated from a dashboard-defined schema (text, number, boolean, date, double fields) and submits the user's responses. Useful for collecting tenant-specific data that doesn't fit the standard verification primitives.

Follows the form-based pattern. See the patterns page for the shared lifecycle.

Availability

This module is headless-only — there is no public <incode-custom-fields> web component. Drive it with createCustomFieldsManager from @incodetech/core/custom-fields and render your own form.

Configuration

type CustomField = {
  name: string; // Internal field name
  alias: string; // User-facing label
  type: 'INTEGER' | 'DOUBLE' | 'BOOLEAN' | 'STRING' | 'DATE';
};

type CustomFieldsConfig = {
  title: string;
  customFields: CustomField[];
};
Option Type Required Description
title string Form title shown above the fields.
customFields CustomField[] Field schema. Each entry's name is the data key, alias is the label, type drives input type.

The schema is defined in the Incode Dashboard and surfaced through the module's config.

State machine

CustomFieldsState is a discriminated union over status:

Status Description
idle Initial state.
inputting Form rendered; user fills fields.
submitting Sending field values to the backend.
success Submission accepted.
finished Terminal.

API methods

Fields come from your dashboard schema, so this module uses one keyed setter rather than a setter per field.

Method Purpose Callable when
load() Fetch the field schema. idle
setField(name, value) Set one field. name is the field's name from the schema; value is a string, number, or boolean matching its type. inputting
submit() Send the collected values. inputting

Plus the universal lifecycle: subscribe, getState, reset, stop.

See also

Was this page helpful?