0.1.7 • Published 8 months ago

@leapfinance/auth-kit v0.1.7

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Leap Auth Kit

this is auth kit for generating token

Installation

yarn add @leapfinance/auth-kit

Getting Started

First, Keep this component in global level or where you want to access it

import { WithLogin } from "@leapfinance/auth-kit";//import
<WithLogin appName={application_name} apiPath={server_path} logo={componey_logo} /> // component

How to use

leapLogin

To initiate Login Form

// init login modal
leapLogin(loginOption) 
loginOption
NameTypeDescriptionDefault
titlestringthat need to show on login modalnull
canClosebooleancan login modal closetrue
phonestringprefilled phone numbernull
callback(token, options?: {phone, subscribedToWhatsapp}) =>voidwhen token generates successfully return token and options.null
canChangeCountryCodebooleanenable multiple country selectorfalse
logostringin case you want new logo on modalnull
enableTrueCallerbooleanenable truecaller logintrue

error

To show error message in modal

leapLogin.error("error message") 

loader

To Show Loader in Login Form

leapLogin.error("error message") 

login status

To check is Logged in

leapLogin.isLogin() // return boolean 

logout

To logout or delete cookies

leapLogin.logout() 

subscribe events

To subscribe events

leapLogin.subscribe(events,cb);
// where cb = (option?: LoginOptionDto) => void 

subscribe events list

Event NameDescription
INIT_LOGINwhen Login form initiate
GENERATE_OTPwhen generate otp action initiate
GENERATE_OTP_SUCCESSwhen generate otp successfully
RESEND_OTPwhen resend otp action initiate
RESEND_OTP_SUCCESSwhen resent otp successfully
LOGIN_WITH_TCwhen login with truecaller
SUBMIT_OTP_SUCCESSwhen otp verify successfully
LOGIN_SUCCESSwhen login successfully
0.1.2

9 months ago

0.1.7

8 months ago

0.1.3

9 months ago

0.1.0

11 months ago

0.0.1-SNAPSHOT-8

2 years ago

0.0.1-SNAPSHOT-7

2 years ago

0.0.1-SNAPSHOT-6

2 years ago

0.0.1-SNAPSHOT-5

2 years ago

0.0.1-SNAPSHOT-4

2 years ago

0.0.1-SNAPSHOT-3

2 years ago

0.0.1-SNAPSHOT-2

2 years ago

0.0.1-SNAPSHOT-1

2 years ago