Javascript SDK
SDK Callback vs Promise
We provide you the flexibility to use either approache when signing in to verify.
Callback
With this approach, the callbacks for onSuccess and onError can be handled in the initialization process of the SDK. This is a valid approach if you are using the default SDK UI component.
callbacks Example
Promise
You may have designed your own login UI and need to hook up the login / sign in button event. This will not be possible with the callbacks approach so we have provided a promise
approach.
Promise Example
With the above code you initialize the sdk
and then use the sdk
to login when you press the button and use await
to wait for the authentication login response.