Authentication

Introduction

Welcome to the Neucron SDK Authentication Module documentation. This module provides functionalities for user authentication, including login, sign-up, password recovery, phone verification, and phone number verification. Before using this module, make sure you have successfully instantiated the Neucron SDK.

Getting Started

To use the Neucron SDK Authentication Module, follow these steps:

  1. Install the Neucron SDK:

    npm install neucron-sdk
  2. Import the SDK into your project:

    import NeucronSDK from "./src/neucron-sdk.js";
    
    const neucron = new NeucronSDK();
  3. Access the Authentication Module:

    const authModule = neucron.authentication;

Login

Authenticate a user with their email and password.

const loginResponse = await authModule.login({ email: "nikhilmatta10@gmail.com", password: "#Nikku478" });
console.log(loginResponse);

Sign-Up

Create a new user account with a unique email and password.

const signUpResponse = await authModule.signUp({ email: "nikhil.matta@timechainlabs.io", password: "#Nikku478" });
console.log(signUpResponse);

Forgot Password

Initiate the process to reset a user's password by providing their email.

const forgotPasswordResponse = await authModule.forgotPassword({ email: "nikhil.matta@timechainlabs.io" });
console.log(forgotPasswordResponse);

Phone Verification

Send an OTP to the user's phone number for verification.

const phoneVerificationResponse = await authModule.phone({ phone: 9634464906, country_code: 91 });
console.log(phoneVerificationResponse);

Verify Phone Number

Verify the provided OTP against the user's phone number.

const verifyPhoneResponse = await authModule.verifyPhoneNo({ phone: '9634464906', otp: '2780' });
console.log(verifyPhoneResponse);

Note: For the Phone Verification and Verify Phone Number functions, you may need to customize the country code and phone number based on your specific requirements.

Feel free to customize this documentation based on your actual API responses, error handling, and any additional features you want to highlight or clarify in your SDK's authentication module.

Last updated