This guide will show you how to migrate an existing project using v2 to v3.
Initializing the Smart UI
The v2 version allowed you to initialize the Smart UI by passing thewidth, height, and ffToken as properties to the <ff-onboarding-widget> in the HTML. That way of initializing has been removed in v3.Please use the recommended way documented in Getting Started
Id Scan Validation opt-in
- This breaking change only affects users of the Smart UI with Id scan verification.
- you may omit the configuration idScanVerification;
- you may also include it with the value true;
- you may include it by passing an object with extra configurations. (See Smart UI Configuraton for more details)
Scoped styles
- This breaking change only affects users of the Smart UI with custom styles
- Also note: you may have been customizing the Smart UI without even realizing it. Your website’s styles might have unintentionally leaked and affected the Smart UI (which this new release prevents from happening). If that happened in any way, it doesn’t disrupt your UI, it wasn’t an issue.
-
In case your styles are inserted as embedded style tags in the head of the document, which could make it difficult to pass styles as a string to the configuration, you may instead assign an
idto that style tag and pass theidto another configuration field, called injectedCssTagID. Don’t include ”#” with the id name. -
If even embedded styles in
<style>tags don’t fit your build cycle, your CSS is most likely built into external files and inserted at runtime time using<link>tags. The same configuration field may be used with<link>tags, by simply assigning an id to the tag and passing it to injectedCssTagID.
This won’t work if the file is hosted in a different domain due to CORS
protection.
When Using Embedded Stylesheets
On v2, it’s possible to style the Smart UI by using embedded styles, with a<style> tag.


injectedCssTagID. The initializer will take care of injecting that CSS.


<link> tag. Styles included this way are available throughout the whole website. This behaves the same as when using embedded styles and affects both Smart UI and the host website.


Attention
To increase security and prevent issues with XSS, the browser might prevent importing an external stylesheet file hosted on a different domain to the one hosting the smart ui. In such cases the stylesheet will be invisible to the Smart UI and the message “FrankieOne: Style tag {tag id} wasn’t found in document.” will be logged to the browser’s console. Please let us know if this prevents your styles from working.
Optional
Note that to prevent that stylesheet from affecting the rest of the website, you need to constrain it with media=“max-width:1px”
Manual CSS
Depending on your setup, the most straightforward way to migrate global styles to scoped styles might be to simply move them from the embedded style tag or external CSS file to the new configuration field injectedCss. Assuming you isolated those styles from the rest of the host website by prefixing each selector with #ff-onboarding-widget, you may simply move them with no impact on the external website. Otherwise, in case the styles are shared, it’s recommended to use one of the options above.Note your string will need to use ES6’s Template Literals (`).

