rtp-ksk-sdk-4
v1.0.0
Published
`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.
Downloads
3
Readme
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.