Include the onboarding script
To get started, add the following script to your application:Start onboarding
Once the script is added, you can access the available methods viawindow.syntage.onboarding. To start the onboarding process, use the init() method. Specify which data you want to request from users.
Example of initialization with sat only:
buroDeCredito only:
Test environment
To use onboarding in sandbox, add the sandbox script to your application. The sandbox script displays a warning that onboarding is in test mode.Event subscriptions
Thewindow.syntage.onboarding object provides a subscribe method to receive onboarding events.
To subscribe to the success event, use the following code:
step parameter returns sat or buroDeCredito.
To subscribe to error events, use the following code:
code and a message. Example of an error:
Error descriptions
- Credential disabled:
credentialDisabled - Credential invalid:
credentialInvalid - Generic error:
error - Unknown error:
unknownError
Content Security Policies
Content Security Policies (CSP) are delivered as a header to your user’s browser by your web server. They declare which dynamic resources are allowed to load on your page. If there is a Content Security Policy issue, you will see something similar to the below error:Tips
If the script is not yet loaded when executinginit(), you can listen for the entityOnboardingLoaded event to ensure proper initialization:
Using with TypeScript
Using with React
In Next.js, you can use the script tag to include this script in your application. When using only React, you can use the react-helmet library to manage scripts. You can also create a custom hook to inject the script into your application:Use
https://onboarding.sandbox.syntage.com/script.min.js when testing onboarding in sandbox.