rtp-ksk-sdk

1.0.27 • Public • Published

rtp-sdk

rtp-sdk is a JavaScript library designed to provide an easy-to-use interface for handling sign-up and sign-in processes, along with establishing necessary listeners for authentication events.

Installation

Install rtp-sdk using npm:

npm install rtp-sdk

Basic Usage

Initialization

To start using the library, first obtain an instance of RTPSDK:

import RTPSDK from 'rtp-sdk';

function App() {
  const rtp = RTPSDK.getInstance();
  // ... additional code ...
}

Available Methods

handleSignUp()

Initiates the sign-up process with an optional userId. If userId is not provided, it will be generated automatically. This method sets up listeners and handles the communication for user registration.

Example of use:

rtp.handleSignUp('yourUserId');

If you want to generate a userId automatically:

rtp.handleSignUp();

handleSignIn(userId)

Initiates the sign-in process with an optional userId. Similar to handleSignUp, if userId is not provided, it will be generated automatically. This method sets up listeners and handles the communication for user login.

Example of use:

rtp.handleSignIn('yourUserId');

If you want to generate a userId automatically:

rtp.handleSignIn();

Configuration

Ensure you have the following environment variable configured:

REACT_APP_AUTH_SITE: This should be set to the URL of the authentication site.

/rtp-ksk-sdk/

    Package Sidebar

    Install

    npm i rtp-ksk-sdk

    Weekly Downloads

    1

    Version

    1.0.27

    License

    ISC

    Unpacked Size

    45.7 kB

    Total Files

    4

    Last publish

    Collaborators

    • eyrockscript