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 React Native 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. Add Network Security Config inside your android/app/src/main/AndroidManifest.xml file into your <application> code block (Only required if you are using the SNA feature):
  1. Change your activity launchMode to singleTop and exported true for your Main Activity:

Step 3: Configure Sign up/Sign in

  1. Import the OTPLESS package on your login page.
login_page.tsx
  1. Add OTPLESS instance and initialize the SDK:
login_page.tsx
  1. Add the following code to Initiate OTPLESS Login Page
login_page.tsx
  1. Add the following code to handle response callback:
login_page.tsx
  1. When user successfully logs in, stop Otpless:
login_page.tsx

Step 4: Tracking Multiple Events

You can observe all events using:
To track and handle specific event categories, use:

Sample Event JSON Payloads

Validate ID Token

Learn how to securely `validate ID token` returned by OTPLESS react native 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 react native SDK to ensure the authenticity of sign-in events from your backend server.