Skip to main content

Quick Start

1

Add HTML Container

<div id="form"></div>
2

Initialize Component

const personal = oneSdk.component("form", {
  name: "PERSONAL",
  type: "manual",
});

// Mount to your container
personal.mount("#form");

Configuration Guide

General Settings

const personal = oneSdk.component('form', {
  name: "PERSONAL",
  type: "manual",
  title: {
    label: "Your Personal Details",
    style: { 'ff-title': {} }
  },
  descriptions: [
    {label: 'We need to collect your data'}
  ],
  logo: {
    src: './assets/logo.png' // path to your logo
  },
  style: {
    'ff-logo': {
      'width': '50px'
    }
  }
});
For more detailed configuration options, please refer to the Field Configuration section below
You can customize fields based on country (using ISO 3166-1 alpha-3 codes) and state:
const personal = oneSdk.component('form', {
  name: "PERSONAL",
  type: "manual",
  personal: {
    countries: {
      AUS: {
        NSW: { /* NSW specific config */ },
        default: { /* Other AU states */ }
      },
      NZL: {
        default: { /* NZ config */ }
      },
      default: {
        default: { /* Default config */ }
      }
    }
  }
});

Field Configuration

Name

Available Fields

  • givenName
  • middleName
  • familyName

Common Properties

  • fieldType: ‘input’
  • dataType: ‘text’
  • label: Custom label
  • hide: true/false
  • rules:
    • required: { value: ‘boolean’, message: ‘string’ }
    • pattern: { value: ‘regex string’, message: ‘string’ }
fields: [
  {
    fieldType: "input",
    name: "givenName",
    label: "Given Name:",
    dataType: 'text',
    hide: false,
    helperText: "As shown on your ID",
    rules: {
      required: {
        value: true,
        message: "Please enter your given name"
      },
      pattern: {
        value: "^[a-zA-Z]+(\\s+[a-zA-Z]+)*$",
        message: "Please use alphabetic characters only"
      }
    }
  }
]

Event Handling

form:personal:loaded

Emitted when the screen is successfully mounted

form:personal:ready

Emitted when form submission is complete and ready for next step

form:personal:failed

Emitted when an error occurs during form operation

Event Listener Example

personal.on("form:personal:ready", (data) => {
  // Handle successful form completion
  console.log("Form completed:", data);
});
Best Practice
Always implement error handling and loading states when working with Personal Screen events to provide a smooth user experience.