Skip to main content

Step 1: Install OTPLESS SDK Dependency

Install the OTPLESS SDK dependency by running the following command in your terminal at the root of your Ionic project:

Step 2: Platform-specific Integrations

  1. Add intent filter inside your android/app/src/main/AndroidManifest.xml file into your Main activity code block:
Replace YOUR_APP_ID with your actual App ID provided in your OTPLESS dashboard.
  1. Change your activity launchMode to singleTop and exported true for your Main Activity:
  1. Add the following override method in android/app/src/main/java/MainActivity.java to handle callback:
  • Import the following classes:
  • Add this code to your onCreate() method in your main activity:
  • Add this code to your onBackPressed() method in your main activity:

Step 3: Configure Sign up/Sign in

  1. Import the OTPLESS package on your login page.
login_page.js
  1. Add OTPLESS instance and declare the variable with YOUR_APP_ID
login_page.js
Replace YOUR_APP_ID with your actual App ID provided in your OTPLESS dashboard.
  1. Add the following code to Initiate OTPLESS Login Page
login_page.js

🏁 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 ionic 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 ionic SDK to ensure the authenticity of sign-in events from your backend server.