[React Native] Authentication API

Login

The loginByUsername method is used to authenticate a user with a username and password.

await VSeeClinicKit.loginByUsername({ username, password })

 

Parameter

Type

Description

Parameter

Type

Description

userName

String

The user’s username.

password

String

The user’s password.

Example Usage

VSeeClinicKit.loginByUsername({ username, password }).then((response) => { if (response.success) { //Use async storage to store token or something else and restore it whenever init VSeeClinicKit VSeeClinicKit.setUserToken(response.data.token); navigation.navigate(ScreenKeys.home); } });

 

Guest Login

The userLogin method is used to authenticate a user with a username and password.

await VSeeClinicKit.loginAsGuest({ first_name, last_name})

Parameter

Type

Description

Parameter

Type

Description

first_name

String

The guest’s first name.

last_name

String

The guest’s last name.

Login By Token (SSO)

The loginBySSOToken method is used to authenticate a user using a single sign-on (SSO) token.

Parameter

Type

Description

Parameter

Type

Description

token

String

The single sign-on token.

Logout

The logout method is used to log out of the VSee Clinic session.

 

Â