ClinicKit Mobile SDK / React Native

Authentication API (React Native)

Login

The loginByUsername method authenticates a user with a username and password.

await VSeeClinicKit.loginByUsername({ username, password })
ParameterTypeDescription
usernameStringThe user's username.
passwordStringThe 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 })
ParameterTypeDescription
first_nameStringThe guest's first name.
last_nameStringThe 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)
ParameterTypeDescription
tokenStringThe single sign-on token.

Logout

The logout method logs out of the VSee Clinic session.

await VSeeClinicKit.logout()