Skip to main content

Step 1: Add SDK Dependency

Begin by adding the OTPLESS SDK to your project. Insert the following script tag in the <head> section of your HTML document.
index.html
Replace YOUR_APP_ID with your actual App ID provided in your OTPLESS dashboard.

Step 2: Initialize SDK and Handle Callback

With the SDK embedded, initialize it and define a callback function to handle authentication responses as shown below.
index.html

Step 3: Create Your UI

Design a user interface for authentication. An example HTML structure could look like this:
login.html

Step 4: Initiate Authentication

Initiate the authentication process based on the user’s selected method by using the initiate method of the SDK.
Object Attributes

Step 5: Verify OTP

To verify the OTP entered by the user, use the verify method with the necessary parameters.

🏁 Checkpoint

To ensure a smooth integration process:
  1. Deploy your app/website with the included OTPLESS SDK.
  2. Conduct tests to verify the sign-in flow functions correctly.
  3. Ensure that after a successful sign-in, the user is redirected back to your app/website and their information is correctly logged in the console.

User Information Response Structure

The structure of the user information returned upon successful sign-in is as follows:
You can check out a complete sample response here.

Next Steps

Validate ID Token

Learn how to securely `validate ID token` returned by OTPLESS vue SDK to ensure the authenticity of sign-in events from your backend server.

Validate Token (Opaque)

Learn how to securely `validate token` returned by OTPLESS vue SDK to ensure the authenticity of sign-in events from your backend server.