To include this package via CDN, use this line of code:
<script type="text/javascript" src="https://js.trulioo.com/latest/main.js"></script>
JavaScript library which streamlines integration with Trulioo.
Exposes TruliooClient to load EmbedID.
This SDK works in conjunction with the Trulioo EmbedId Middleware.
Instantiate EmbedID through the TruliooClient constructor:
function handleResponse(e) {
console.log('@handleResponse', e);
}
const publicKey = 'PUT_YOUR_PUBLIC_KEY_HERE'; // Public Key
new TruliooClient({
publicKey,
handleResponse
});
Have a look at the example.html file.
An example of using the optional parameters is in the example.html file.
You can optionally define a function called onInitialRenderComplete and pass it to the TruliooClient.
onInitialRenderComplete will be called when initialization has been completed.
TruliooClient supports taking two optional arguments for localization: the locale and defaultLocale parameters. These parameters can be used to render the app in a language other than english.
Localization will be enabled if any of these arguments are passed in with non-empty values. Otherwise, 'en-US' will be used.
When localization is not enabled, the end user's browser locale is never considered.
When multiple options are available, the language being used will be chosen in the following order:
- If a supported locale is passed to TruliooClient, it will be used.
- If the locale is not passed or not supported, the end user's browser locale will be used
- If the above options are not supported, the value of defaultLocale passed to TruliooClient will be used
- If none of the above options are supported, en-US will be used
Only language and optionally region values are expected. Capitalization and subregions are ignored. Underscore and hyphens are considered interchangable. For example, 'en', 'en-US' and 'en_us' are ok.
See documentation for a list of supported languages and their associated locale codes.
Must update the main.js prior pull request to master
npm run webpack-release