OTPLessAuth Node.js SDK
The OTPLessAuth Node.js SDK is a powerful library that enables you to decode ID tokens and perform authentication using the OTPLess service. This SDK simplifies the integration of OTPLess authentication into your Node.js applications.
Installation
You can install the OTPLessAuth SDK using npm:
npm install otpless-auth-sdk
Usage
To use the OTPLessAuth SDK in your Node.js application, follow these steps:
- Import the necessary modules:
const OTPLessAuth = require("otpless-auth-sdk");
const idToken = "...";
const clientId = "...";
const clientSecret = "...";
const userDetail = await OTPLessAuth.decodeIdToken(
idToken,
clientId,
clientSecret
);
console.log("User Details:", userDetail);
API Reference
OTPLessAuth.decodeIdToken(idToken, clientId, clientSecret)
This method decodes an ID token using the provided client ID and client secret, and returns user details in a structured format.
idToken: The ID token to decode.
clientId: Your application's client ID.
clientSecret: Your application's client secret.
Returns: A user details object.
License
This SDK is released under the MIT License.
Support and Feedback
If you have any questions or encounter any issues while using this SDK, please feel free to open an issue on our GitHub repository.