Login SDK
Learn about Login SDK integration
Requirements
Login Page URL Cname Redirection
Before starting the process, the login page URL to be used must be redirected to lcname.zotlo.com as Cname.
Adding JavaScript File
In order to log in users with Zotlo Web SDK, the relevant javascript file must be added to the login screen as in the example below.
Creating Login Button
After adding the JavaScript file, you can create the login button to be added to your page with the following methods:
If you want to create the login button manually, you need to add "Zotlo.login()" to the onclick event of the button element you will add to your html page as in the example below.
If you want to create the login button automatically, you need to add the following div element to your html page.
Add the JavaScript Code
After creating your login button with one of the steps above, the following JavaScript code is required to be added to your page:
When users click on the "Sign in with SMS" button, pop-up verification screens open and when the verification process is completed, a token value is sent to the redirectUrl address defined in "Zotlo.init" with the GET
method in order to receive subscription information.
With the token value sent to your RedirectUrl address, you can check whether there is user benefit or not by sending a request to the purchaseList API endpoint with the Access Key and Access Secret information of your application.
Access Key and Access Secret information will be sent by Zotlo onboarding team.
Development
If webhooks are defined in the application, you can regularly track the benefit status of the users and receive updates. If webhooks are not defined, the benefit status of the users will be sent to the application end at each login process. Session management of users who are logged in and whose benefits have expired should be carried out on the application end.
Example Request
Successful Result
Failed Result
Last updated