Authentication API (React Native)
Login
The loginByUsername method authenticates a user with a username and password.
await VSeeClinicKit.loginByUsername({ username, password })
| 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 the token and restore it whenever you init VSeeClinicKit
VSeeClinicKit.setUserToken(response.data.token);
navigation.navigate(ScreenKeys.home);
}
});
Guest login
The loginAsGuest method logs a user in as a guest, using their first and last name.
await VSeeClinicKit.loginAsGuest({ first_name, last_name })
| 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 authenticates a user with a single sign-on (SSO) token.
await VSeeClinicKit.loginBySSOToken(token: string)
| Parameter | Type | Description |
|---|---|---|
token | String | The single sign-on token. |
Logout
The logout method logs out of the VSee Clinic session.
await VSeeClinicKit.logout()