Advanced Tutorial: KYC Plugin web views

We will go over how to develop home and verification web views for the KYC plugin.

Step 1: Initialize the KYC plugin web view.

Run the following commands to initialize the plugin web view:

cd web/
npm run add-plugin --plugin=kyc --type=kyc

Step 2: Install the initial plugin.

Run the following commands to build the initial plugin with a default view and install the plugin.

cd ..
npm run build --plugin=kyc

Step 3: disable CORS error on the browser.

The web view JSON file and bundles are served on the localhost port 8080. In order to allow the kit to access them in plugin development mode, we need to disable the CORS issue on the browser. This can be achieved by using a browser extension.

Step 4: Plugin interactive development mode

To start using interactive plugin development mode, we need to run the commands of steps 5 and 6 simultaneously.

Step 5: Create, watch and serve web view bundles and the JSON file.

Run the following command on the plugin starter kit web directory:

Step 6: Start Hollaex kit plugin development mode.

Run the following command on the Hollaex kit web directory:

In order to see the plugin's changes, we need to refresh the page after every change.

Step 7: Update home Form.js component.

Then add the following component to the Form.js file.

In this component, we are getting the following common props and target-specific props from the kit context using the withKit HOC.

  • Common props: strings, activeLanguage, user, icons

  • Target-specific props: setActivePageContent, handleBack, getCountry, getFormatTimestamp

See the SmartTarget with REMOTE_COMPONENT__KYC_VERIFICATION_HOME id on the verification container component for more details about the props.

Step 8: Add home components.

Documents

Identityocalhost:3000/hello-exchange.

Step 9: Update verification Form.js component.

In this component, we are getting the following common and target-specific props from the kit context using the withKit HOC.

  • Common props: strings, user, constants

  • Target-specific props: handleBack, identityInitialValues, documentInitialValues

See the SmartTarget with REMOTE_COMPONENT__KYC_VERIFICATION id on the verification container component for more details about the props.

Step 10: Add verification components.

Documents

See the SmartTarget with REMOTE_COMPONENT__KYC_VERIFICATION id on the verification container component for more details about the props passed using the kit context.

Identity

See the SmartTarget with REMOTE_COMPONENT__KYC_VERIFICATION id on the verification container component for more details about the props passed using the kit context.

HeaderSection

Step 11: Install the plugin.

Uninstall the initial plugin. Then run the following commands to build the plugin again. Then install the plugin JSON file on the kit.

Last updated