/
[React Native] Authentication API
[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 |
---|---|---|
|
| The user’s username. |
|
| 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 |
---|---|---|
|
| The guest’s first name. |
|
| 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 |
---|---|---|
|
| The single sign-on token. |
Logout
The logout
method is used to log out of the VSee Clinic session.