Plain HTML integration
Include the Fintoc script in the HTML of each page that uses the Widget.window.onloadWait for the browser to load the Fintoc script before calling its functions. Use the native window.onload event to run code after the script loads.ES module integration
You can also install the@fintoc/fintoc-js library through npm and use the Widget as an ES module.
getFintoc method, which returns the Fintoc object.
How it works
Include the Fintoc script in your application or callgetFintoc from the @fintoc/fintoc-js library. You can then use the Fintoc class to connect an account at a financial institution.
Javascript
Call
widget.open() to open the Widget.Use the Widget callbacks and events correctlyNever use the
onSuccess, onExit, or onEvent callbacks to determine the resource state. Use these callbacks only to control your frontend flow while waiting for backend confirmation. Confirm the resource state through webhooks or an exchange token. You can use frontend events to measure Widget usage. Do not rely on frontend events to determine whether resource creation succeeded or failed.Username object
To prefill a username and control whether it can be edited, send an object with the following attributes:JSON
Prefilling the username increases payment conversionFintoc testing shows that prefilling the username increases payment conversion by approximately 3%.
Methods of the Widget object
After you create awidget object, use its open, close, and destroy methods to control it:
How to use the
widget.destroy() methodFintoc.create(args) embeds an iframe in your application. When developing a single-page application, call widget.destroy() to remove the iframe. To reopen the Widget, create a new instance with Fintoc.create(args).