> ## Documentation Index
> Fetch the complete documentation index at: https://docs.frankieone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrating from v3 to v4

> Learn how to migrate to the latest version of Smart UI if you have already integrated with version 3.

Migrate to version 4 of Smart UI in order to benefit from the following:

* Faster loading due to a much improved reduced bundle size.
* Support for digital driver's licenses (opt-in).
* Improved error handling and reporting.
* Support for uploading supporting documents.

**Version 4 also updates the end-user experience for users in Indonesia**:

* When inputting an Indonesian document, users will be prompted to add their name, they will be provided with a second name screen where they can review their input.

***

## Prerequisites

These instructions assume that you have already integrated with version 3 of Smart UI. If this isn't the case, explore the [migration guides for other versions](/docs/v1/onesdk/Smart-ui-for-deprecation/version-4-migration/migrating-v2-to-v3).

***

### Step 1: Update the `<script>` element

Update the `<script>` element to reference the latest version of Smart UI.

If using the minified bundle, the `<script>` element should look like:

```html theme={null}
<script src="https://assets.frankiefinancial.io/onboarding/v4/ff-onboarding-widget.umd.min.js"></script>
```

If you were using the non-minified bundle, your `<script>` element should look like:

```html theme={null}
<script src="https://assets.frankiefinancial.io/onboarding/v4/ff-onboarding-widget.umd.js"></script>
```

***

### Step 2: Update the Content Security Policy

If your website uses a [Content Security Policy <Icon icon="arrow-up-right-from-square" size={12} />](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) (CSP) you will need to update it to allow `img-src` content from `assets.frankiefinancial.io`.

***

### Step 3 (Optional): Allow digital driver's licenses

<Callout icon="thumbtack" color="#1A6CFF" iconType="regular">
  ##### Biometrics Only

  If your Smart UI configuration enables Biometrics and you will to accept digital driver's licenses, then you will need to update your configuration.

  If your configuration doesn't enable Biometrics or you only accept physical IDs, then you may skip this step.
</Callout>

Update the configuration object that's passed to the `initialiseOnboardingWidget()` method to opt-in to allowing digital driver's licenses.

If your configuration object doesn't contain the `documentTypes` key or you don't wish to allow digital driver's licenses then you can safely ignore this step.

Replace the string value `"DRIVERS_LICENCE"` with the following object:

```json JSON theme={null}
{
  "type": "DRIVERS_LICENCE",
  "digitalLicense": true
}
```

<Accordion title="Before:">
  ```json JSON theme={null}
  frankieFinancial.initialiseOnboardingWidget({
    config: {
      documentTypes: [
        "DRIVERS_LICENCE",
        // Other document types
      ],
      // Other configuration parameters
    },
    // Other initialisation parameters
  });
  ```
</Accordion>

<Accordion title="After:">
  ```json JSON theme={null}
  frankieFinancial.initialiseOnboardingWidget({
    config: {
      documentTypes: [
        {
          "type": "DRIVERS_LICENCE",
          "digitalLicense": true
        },
        // Other document types
      ],
      // Other configuration parameters
    },
    // Other initialisation parameters
  });
  ```
</Accordion>

***

## Next steps

Version 4 can allow your users to upload supporting documents. To make use of this feature, we recommend speaking to our team first.
