# @ovok/native/auth

Canonical page: https://docs.ovok.com/native-sdk/reference/auth

Sign-in, registration, password reset, profile and session components and hooks.

Import from `@ovok/native/auth`.

## Components [#components]

### DeleteAccountButton() [#deleteaccountbutton]

```ts
function DeleteAccountButton(__namedParameters): Element;
```

Button that asks for confirmation, then deletes the account and signs out.

#### Parameters [#parameters]

| Parameter | Type |
| ------ | ------ |
| `__namedParameters` | `DeleteAccountButtonProps` |

#### Returns [#returns]

`Element`

***

### LogoutButton() [#logoutbutton]

```ts
function LogoutButton(__namedParameters): Element;
```

Button or row that signs the user out.

#### Parameters [#parameters-1]

| Parameter | Type |
| ------ | ------ |
| `__namedParameters` | `LogoutButtonProps` |

#### Returns [#returns-1]

`Element`

***

### ProfileForm() [#profileform]

```ts
function ProfileForm(props): Element;
```

Profile form wrapped in its provider.

#### Parameters [#parameters-2]

| Parameter | Type |
| ------ | ------ |
| `props` | [`ProfileFormProps`](#profileformprops) |

#### Returns [#returns-2]

`Element`

***

### Register() [#register]

```ts
function Register(props): Element;
```

Scrollable registration screen layout; compose it with the `Register.*` parts.

#### Parameters [#parameters-3]

| Parameter | Type |
| ------ | ------ |
| `props` | `KeyboardAwareScrollViewProps` |

#### Returns [#returns-3]

`Element`

***

### ResetPassword() [#resetpassword]

```ts
function ResetPassword(props): Element;
```

Scrollable reset password screen layout; compose it with the `ResetPassword.*` parts.

#### Parameters [#parameters-4]

| Parameter | Type |
| ------ | ------ |
| `props` | `KeyboardAwareScrollViewProps` |

#### Returns [#returns-4]

`Element`

***

### SessionList() [#sessionlist]

```ts
function SessionList(__namedParameters): Element;
```

Lists the active sessions and lets the user sign out the other devices.

#### Parameters [#parameters-5]

| Parameter | Type |
| ------ | ------ |
| `__namedParameters` | [`SessionListProps`](#sessionlistprops) |

#### Returns [#returns-5]

`Element`

***

### SignIn() [#signin]

```ts
function SignIn(props): Element;
```

Scrollable sign-in screen layout; compose it with the `SignIn.*` parts.

#### Parameters [#parameters-6]

| Parameter | Type |
| ------ | ------ |
| `props` | `KeyboardAwareScrollViewProps` |

#### Returns [#returns-6]

`Element`

## Hooks [#hooks]

### useAcceptInviteLink() [#useacceptinvitelink]

```ts
function useAcceptInviteLink(__namedParameters): object;
```

Accepts an invite link, or creates a carer account from a record-share invite.

#### Parameters [#parameters-7]

| Parameter | Type |
| ------ | ------ |
| `__namedParameters` | [`AcceptInviteLinkOptions`](#acceptinvitelinkoptions) |

#### Returns [#returns-7]

| Name | Type | Description |
| ------ | ------ | ------ |
| `accept` | `Omit`\<[`AuthActionState`](#authactionstate)\<`RecordShareAccepted`\>, `"run"`\> & `object` | Accepts the invite link for the signed-in profile. |
| `createCarerAccount` | `Omit`\<[`AuthActionState`](#authactionstate)\<\{ `login`: `LoginResult`; `share`: `RecordShareAccepted`; \}\>, `"run"`\> & `object` | Accepts a record-share invite and signs in the new carer account. |

***

### useAuthAction() [#useauthaction]

```ts
function useAuthAction<TArgs, TResult>(action): Omit<AuthActionState<TResult>, "run"> & object;
```

Wraps an async auth action with status, loading and error state; concurrent runs share one call.

#### Type Parameters [#type-parameters]

| Type Parameter |
| ------ |
| <a id="type-parameter-targs"></a> `TArgs` *extends* `unknown`[] |
| <a id="type-parameter-tresult-1"></a> `TResult` |

#### Parameters [#parameters-8]

| Parameter | Type |
| ------ | ------ |
| `action` | (...`args`) => `Promise`\<`TResult`\> |

#### Returns [#returns-8]

`Omit`\<[`AuthActionState`](#authactionstate)\<`TResult`\>, `"run"`\> & `object`

***

### useDeleteAccount() [#usedeleteaccount]

```ts
function useDeleteAccount(__namedParameters?): Omit<AuthActionState<void>, "run"> & object;
```

Deletes the signed-in account and signs out.

#### Parameters [#parameters-9]

| Parameter | Type |
| ------ | ------ |
| `__namedParameters?` | [`DeleteAccountOptions`](#deleteaccountoptions) |

#### Returns [#returns-9]

`Omit`\<[`AuthActionState`](#authactionstate)\<`void`\>, `"run"`\> & `object`

***

### useRateLimitCooldown() [#useratelimitcooldown]

```ts
function useRateLimitCooldown(until?): number;
```

Returns the milliseconds left until `until` (epoch milliseconds), updating every second.

#### Parameters [#parameters-10]

| Parameter | Type |
| ------ | ------ |
| `until?` | `number` |

#### Returns [#returns-10]

`number`

***

### useSession() [#usesession]

```ts
function useSession(__namedParameters?): UseSessionResult;
```

Tracks the current Ovok session, saved accounts and profile.

#### Parameters [#parameters-11]

| Parameter | Type |
| ------ | ------ |
| `__namedParameters?` | [`UseSessionOptions`](#usesessionoptions) |

#### Returns [#returns-11]

[`UseSessionResult`](#usesessionresult)

***

### useSignIn() [#usesignin]

```ts
function useSignIn(options): object;
```

Signs in with email and password and verifies the MFA challenge when one is required.

#### Parameters [#parameters-12]

| Parameter | Type |
| ------ | ------ |
| `options` | [`SignInOptions`](#signinoptions) |

#### Returns [#returns-12]

| Name | Type | Default value | Description |
| ------ | ------ | ------ | ------ |
| `error?` | `Error` | - | Error of the last run, if it failed. |
| `loading` | `boolean` | - | Whether the action is running. |
| `mfaError` | `Error` \| `undefined` | `verifyMfa.error` | Error of the last MFA verification. |
| `mfaLoading` | `boolean` | `verifyMfa.loading` | Whether MFA verification is running. |
| `mfaStatus` | [`AuthActionStatus`](#authactionstatus) | `verifyMfa.status` | Stage of the MFA verification. |
| `reset()` | () => `void` | - | Returns the action to `idle` and clears the error. |
| `run()` | (...`args`) => `Promise`\<`LoginResult`\> | - | Runs the action with `args`; a call made while one is pending returns the pending promise. |
| `status` | [`AuthActionStatus`](#authactionstatus) | - | Current stage. |
| `verifyMfa()` | (...`args`) => `Promise`\<`LoginResult`\> | `verifyMfa.run` | Verifies an MFA challenge with the code the user entered. |

***

### useSignOut() [#usesignout]

```ts
function useSignOut(): Omit<AuthActionState<void>, "run"> & object;
```

Signs out the current session.

#### Returns [#returns-13]

`Omit`\<[`AuthActionState`](#authactionstate)\<`void`\>, `"run"`\> & `object`

***

### useSocialSignIn() [#usesocialsignin]

```ts
function useSocialSignIn(options): Omit<AuthActionState<Session>, "run"> & object;
```

Signs in with Google or Apple and exchanges the credentials for an Ovok session.

#### Parameters [#parameters-13]

| Parameter | Type |
| ------ | ------ |
| `options` | [`SocialSignInOptions`](#socialsigninoptions) |

#### Returns [#returns-14]

`Omit`\<[`AuthActionState`](#authactionstate)\<`Session`\>, `"run"`\> & `object`

## Functions [#functions]

### getRateLimitDetails() [#getratelimitdetails]

```ts
function getRateLimitDetails(error): RateLimitDetails | undefined;
```

Supports @ovok/core's typed error while remaining compatible with HTTP 429 adapters.

#### Parameters [#parameters-14]

| Parameter | Type |
| ------ | ------ |
| `error` | `unknown` |

#### Returns [#returns-15]

[`RateLimitDetails`](#ratelimitdetails) \| `undefined`

***

### isNetworkError() [#isnetworkerror]

```ts
function isNetworkError(error, message?): boolean;
```

Whether the error, or its message, indicates a network failure.

#### Parameters [#parameters-15]

| Parameter | Type |
| ------ | ------ |
| `error` | `unknown` |
| `message?` | `unknown` |

#### Returns [#returns-16]

`boolean`

***

### parseInviteLink() [#parseinvitelink]

```ts
function parseInviteLink(link): AcceptInviteBody;
```

Reads `invite` and `code` from an `…/accept-invite?invite=…&code=…` link.

#### Parameters [#parameters-16]

| Parameter | Type |
| ------ | ------ |
| `link` | `string` |

#### Returns [#returns-17]

`AcceptInviteBody`

***

### parseSignInError() [#parsesigninerror]

```ts
function parseSignInError(error, options?): ParsedSignInError;
```

Converts auth transport/server failures to safe, translatable error keys.

#### Parameters [#parameters-17]

| Parameter | Type |
| ------ | ------ |
| `error` | `unknown` |
| `options?` | \{ `errorScope?`: `"register"` \| `"reset-password"`; `isMfaVerification?`: `boolean`; `isSignIn?`: `boolean`; \} |
| `options.errorScope?` | `"register"` \| `"reset-password"` |
| `options.isMfaVerification?` | `boolean` |
| `options.isSignIn?` | `boolean` |

#### Returns [#returns-18]

[`ParsedSignInError`](#parsedsigninerror)

***

### setRateLimitFormError() [#setratelimitformerror]

```ts
function setRateLimitFormError<T>(error, helpers): RateLimitDetails | undefined;
```

Writes the rate limit error and cooldown deadline to the Formik form; returns the details, or `undefined` when the error is not a rate limit.

#### Type Parameters [#type-parameters-1]

| Type Parameter |
| ------ |
| <a id="type-parameter-t"></a> `T` |

#### Parameters [#parameters-18]

| Parameter | Type |
| ------ | ------ |
| `error` | `unknown` |
| `helpers` | `FormikHelpers`\<`T`\> |

#### Returns [#returns-19]

[`RateLimitDetails`](#ratelimitdetails) \| `undefined`

## Interfaces [#interfaces]

### AcceptInviteLinkOptions [#acceptinvitelinkoptions]

Options of `useAcceptInviteLink`.

#### Properties [#properties]

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="property-tenantcode"></a> `tenantCode` | `string` | Tenant a new carer account signs in to. |

***

### AuthActionState [#authactionstate]

State of an auth action.

#### Type Parameters [#type-parameters-2]

| Type Parameter |
| ------ |
| <a id="type-parameter-tresult"></a> `TResult` |

#### Properties [#properties-1]

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="property-error"></a> `error?` | `Error` | Error of the last run, if it failed. |
| <a id="property-loading"></a> `loading` | `boolean` | Whether the action is running. |
| <a id="property-reset"></a> `reset` | () => `void` | Returns the action to `idle` and clears the error. |
| <a id="property-run"></a> `run` | () => `Promise`\<`TResult`\> | Runs the action. |
| <a id="property-status"></a> `status` | [`AuthActionStatus`](#authactionstatus) | Current stage. |

***

### DeleteAccountOptions [#deleteaccountoptions]

Options of `useDeleteAccount`.

#### Properties [#properties-2]

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="property-days"></a> `days?` | `number` | Days before the deletion becomes final. |
| <a id="property-wipe"></a> `wipe?` | `boolean` | Whether to also wipe the account data. |

***

### ParsedSignInError [#parsedsigninerror]

Sign-in error and the per-field errors parsed from it.

#### Properties [#properties-3]

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="property-error-1"></a> `error` | [`SignInError`](#signinerror) | Normalized error. |
| <a id="property-fielderrors"></a> `fieldErrors` | `ValidationError`[] | Validation errors keyed by field. |

***

### RateLimitDetails [#ratelimitdetails]

Rate limit information extracted from an error.

#### Properties [#properties-4]

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="property-messagekey"></a> `messageKey` | `string` | Translation key of the message to show. |
| <a id="property-retryafterms"></a> `retryAfterMs` | `number` | Milliseconds until the user may retry. |

***

### SignInCredentials [#signincredentials]

Email and password to sign in with.

#### Properties [#properties-5]

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="property-email"></a> `email` | `string` | Account email. |
| <a id="property-password"></a> `password` | `string` | Account password. |

***

### UseSessionOptions [#usesessionoptions]

Options of `useSession`.

#### Properties [#properties-6]

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="property-refreshonforeground"></a> `refreshOnForeground?` | `boolean` | Whether to refresh when the app returns to the foreground. |
| <a id="property-sessions"></a> `sessions?` | `boolean` | Whether to load the list of active sessions. |

***

### UseSessionResult [#usesessionresult]

Session state and actions returned by `useSession`.

#### Extends [#extends]

- `SessionSnapshot`

#### Properties [#properties-7]

| Property | Type | Description | Inherited from |
| ------ | ------ | ------ | ------ |
| <a id="property-accounts"></a> `accounts` | `SavedAccount`[] | Saved accounts on this device. | `SessionSnapshot.accounts` |
| <a id="property-activeaccountid"></a> `activeAccountId?` | `string` | ID of the active saved account. | `SessionSnapshot.activeAccountId` |
| <a id="property-error-2"></a> `error?` | `Error` | Last session error. | `SessionSnapshot.error` |
| <a id="property-isauthenticated"></a> `isAuthenticated` | `boolean` | Whether a user is signed in. | - |
| <a id="property-loading-1"></a> `loading` | `boolean` | Whether the session is loading. | - |
| <a id="property-logout"></a> `logout` | () => `Promise`\<`void`\> | Signs out the active account. | - |
| <a id="property-patientid"></a> `patientId?` | `string` | ID of the signed-in patient, when the profile is a patient. | - |
| <a id="property-profile"></a> `profile?` | `Profile` | FHIR profile of the active account. | `SessionSnapshot.profile` |
| <a id="property-profileaccountid"></a> `profileAccountId?` | `string` | Account the loaded profile belongs to. | `SessionSnapshot.profileAccountId` |
| <a id="property-reason"></a> `reason?` | `"session-ended"` | Why the user was signed out, when the session ended on its own. | `SessionSnapshot.reason` |
| <a id="property-refresh"></a> `refresh` | () => `Promise`\<`void`\> | Reloads the session, accounts and profile. | - |
| <a id="property-refreshsessions"></a> `refreshSessions` | () => `Promise`\<`void`\> | Reloads the list of active sessions. | - |
| <a id="property-removeaccount"></a> `removeAccount` | (`accountId`) => `Promise`\<`void`\> | Removes a saved account. | - |
| <a id="property-revokesessions"></a> `revokeSessions` | (`option`) => `Promise`\<`void`\> | Revokes sessions according to the option. | - |
| <a id="property-sessions-1"></a> `sessions` | `OvokNativeSession`[] | Active sessions of the account. | `SessionSnapshot.sessions` |
| <a id="property-status-1"></a> `status` | `SessionStatus` | Authentication status. | `SessionSnapshot.status` |
| <a id="property-switchaccount"></a> `switchAccount` | (`accountId`) => `Promise`\<`void`\> | Makes the saved account the active one. | - |
| <a id="property-switching"></a> `switching` | `boolean` | Whether an account switch is in progress. | `SessionSnapshot.switching` |

## Type Aliases [#type-aliases]

### AppleLoginProps [#appleloginprops]

```ts
type AppleLoginProps = Omit<TouchableOpacityProps, "onPress" | "onPressIn" | "onPressOut" | "onLongPress" | "children"> & object;
```

Props of `SignIn.SocialLogins.AppleLogin`.

#### Type Declaration [#type-declaration]

| Name | Type | Description |
| ------ | ------ | ------ |
| `appleRedirectUri?` | `string` | Web only: a Return URL registered for the Services ID. Defaults to this site's origin. |
| `appleServicesId?` | `string` | Web only: the Services ID Apple signs the user in for. Without it the button renders nothing on the web. |
| `children` | `React.ReactNode` | Button content, usually `AppleLogin.Icon` and `AppleLogin.Text`. |
| `internalId` | `string` | The `external-auth-internal-id` of the Apple entry on the ClientApplication; the web needs its own entry. |
| `onError()?` | (`error`) => `void` | Called when sign-in fails; a cancelled sign-in is not an error. |
| `onSuccess()?` | (`loginResponse`) => `void` | Called with the session once the user has signed in. |
| `testID?` | `string` | Test identifier of the button. |

***

### AuthActionStatus [#authactionstatus]

```ts
type AuthActionStatus = "idle" | "loading" | "success" | "error";
```

Stage of an auth action.

***

### FooterProps [#footerprops]

```ts
type FooterProps = object;
```

Props of the sign-in footer.

#### Properties [#properties-8]

##### testID? [#testid]

```ts
testID?: string;
```

Test identifier of the footer.

***

### GoogleLoginProps [#googleloginprops]

```ts
type GoogleLoginProps = Omit<TouchableOpacityProps, "onPress" | "onPressIn" | "onPressOut" | "onLongPress" | "children"> & object;
```

Props of `SignIn.SocialLogins.GoogleLogin`.

#### Type Declaration [#type-declaration-1]

| Name | Type | Description |
| ------ | ------ | ------ |
| `children` | `React.ReactNode` | Button content, usually `GoogleLogin.Icon` and `GoogleLogin.Text`. |
| `googleIosClientId` | `string` | Google OAuth client ID for iOS; the web ignores it. |
| `googleRedirectUri?` | `string` | Web only: the redirect URI Google returns to, which must be an Authorized redirect URI of the web client. Defaults to `/oauth/google.html` on this site, where the app serves `GOOGLE_RETURN_PAGE_HTML`. |
| `googleWebClientId` | `string` | Google OAuth web client ID. On the web it is the client ID the sign-in page asks Google for. |
| `internalId` | `string` | The `external-auth-internal-id` of the Google entry on the ClientApplication. |
| `onError()?` | (`error`) => `void` | Called when sign-in fails; a cancelled sign-in is not an error. |
| `onSuccess()?` | (`loginResponse`) => `void` | Called with the session once the user has signed in. |
| `testID?` | `string` | Test identifier of the button. |

***

### LoginFormProps [#loginformprops]

```ts
type LoginFormProps = object & (
  | {
  onError?: (error) => void;
  onSubmit?: undefined;
  onSuccess?: (response) => void;
}
  | {
  onError?: undefined;
  onSubmit?: (values, formikHelpers) => Promise<void>;
  onSuccess?: undefined;
}) & (
  | {
  loginType: "Patient" | "RelatedPerson";
  tenantCode: string;
}
  | {
  loginType: "Practitioner";
  tenantCode?: string;
});
```

Props of the sign-in form.

#### Type Declaration [#type-declaration-2]

| Name | Type | Description |
| ------ | ------ | ------ |
| `children?` | `React.ReactNode` | Content rendered inside the form. |
| `customValidations?` | \{ \[key in keyof LoginFormValues\]?: Yup.StringSchema \| ((existingRule: Yup.StringSchema) =\> Yup.StringSchema) \} | Per-field validation rules or functions that extend the default rule. |
| `style?` | `StyleProp`\<`ViewStyle`\> | Style of the form container. |
| `testID?` | `string` | Test identifier of the form. |

***

### LoginWithSeparatorProps [#loginwithseparatorprops]

```ts
type LoginWithSeparatorProps = object;
```

Props of the sign-in separator.

#### Properties [#properties-9]

##### lineColor? [#linecolor]

```ts
lineColor?: string;
```

Color of the separator lines.

##### testID? [#testid-1]

```ts
testID?: string;
```

Test identifier of the separator.

##### textColor? [#textcolor]

```ts
textColor?: string;
```

Color of the separator text.

***

### ProfileFormField [#profileformfield]

```ts
type ProfileFormField = ProfileFormFieldBase & (
  | {
  options: object[];
  type: "select";
}
  | {
  display?: DateFieldProps["display"];
  formatValue?: DateFieldProps["formatValue"];
  initialDate?: DateFieldProps["initialDate"];
  locale?: DateFieldProps["locale"];
  maximumDate?: DateFieldProps["maximumDate"];
  minimumDate?: DateFieldProps["minimumDate"];
  mode?: DateFieldProps["mode"];
  type: "date";
}
  | {
  inputProps?: TextInputFieldProps;
  keyboardType?: TextInputProps["keyboardType"];
  type: "text";
}
  | {
  options: object[];
  type: "choice";
}
  | {
  countryName?: (code, language) => string;
  defaultCountry: CountryCode;
  type: "phone";
});
```

Field definition of the profile form, discriminated by `type`.

***

### ProfileFormProps [#profileformprops]

```ts
type ProfileFormProps = object;
```

Props of the profile form.

#### Properties [#properties-10]

##### fields [#fields]

```ts
fields: ProfileFormField[];
```

Fields to render and edit.

##### onError? [#onerror]

```ts
onError?: (error) => void;
```

Called when saving fails.

###### Parameters [#parameters-19]

| Parameter | Type |
| ------ | ------ |
| `error` | `unknown` |

###### Returns [#returns-20]

`void`

##### onSubmit? [#onsubmit]

```ts
onSubmit?: (values, formikHelpers) => Promise<void> | void;
```

Replaces the default save; use it to handle the submitted values yourself.

###### Parameters [#parameters-20]

| Parameter | Type |
| ------ | ------ |
| `values` | [`ProfileFormValues`](#profileformvalues) |
| `formikHelpers` | `FormikHelpers`\<[`ProfileFormValues`](#profileformvalues)\> |

###### Returns [#returns-21]

`Promise`\<`void`\> \| `void`

##### onSuccess? [#onsuccess]

```ts
onSuccess?: (response, values) => Promise<void> | void;
```

Called with the updated patient and the submitted values after a successful save.

###### Parameters [#parameters-21]

| Parameter | Type |
| ------ | ------ |
| `response` | `Patient` |
| `values` | [`ProfileFormValues`](#profileformvalues) |

###### Returns [#returns-22]

`Promise`\<`void`\> \| `void`

##### style? [#style]

```ts
style?: StyleProp<ViewStyle>;
```

Style of the form container.

##### testID? [#testid-2]

```ts
testID?: string;
```

Test identifier of the form.

***

### ProfileFormValues [#profileformvalues]

```ts
type ProfileFormValues = object;
```

Profile form values keyed by field name.

#### Indexable [#indexable]

```ts
[key: string]: string
```

#### Properties [#properties-11]

##### submit [#submit]

```ts
submit: string;
```

Holds the submit error message.

***

### RegisterFormValues [#registerformvalues]

```ts
type RegisterFormValues = PatientRegistration & object;
```

Registration values plus form-only fields.

#### Type Declaration [#type-declaration-3]

| Name | Type | Description |
| ------ | ------ | ------ |
| `fullName?` | `string` | Full name, split into name and surname by the app. |
| `submit` | `string` | Holds the submit error message. |

***

### ResetPasswordButtonProps [#resetpasswordbuttonprops]

```ts
type ResetPasswordButtonProps = AuthSubmitButtonProps;
```

Props of the reset password submit button.

***

### ResetPasswordContextType [#resetpasswordcontexttype]

```ts
type ResetPasswordContextType = ReturnType<typeof useFormik> & object;
```

Formik state of the reset password form.

#### Type Declaration [#type-declaration-4]

| Name | Type | Description |
| ------ | ------ | ------ |
| `typeLocked?` | `boolean` | Whether the profile type is fixed and its input hidden. |

***

### ResetPasswordFormValues [#resetpasswordformvalues]

```ts
type ResetPasswordFormValues = object;
```

Values of the reset password form.

#### Properties [#properties-12]

##### email [#email]

```ts
email: string;
```

Account email.

##### submit [#submit-1]

```ts
submit: string;
```

Holds the submit error message.

##### type [#type]

```ts
type: "Patient" | "Practitioner" | "RelatedPerson";
```

Profile type of the account.

***

### ResetPasswordHeaderProps [#resetpasswordheaderprops]

```ts
type ResetPasswordHeaderProps = AuthHeaderProps;
```

Props of the reset password header.

***

### ResetPasswordProps [#resetpasswordprops]

```ts
type ResetPasswordProps = KeyboardAwareScrollViewProps;
```

Props of `ResetPassword`.

***

### SessionListProps [#sessionlistprops]

```ts
type SessionListProps = ViewProps & object;
```

Props of `SessionList`: view props plus an error callback.

#### Type Declaration [#type-declaration-5]

| Name | Type | Description |
| ------ | ------ | ------ |
| `onError()?` | (`error`) => `void` | Called when loading or revoking sessions fails. |

***

### SigninButtonProps [#signinbuttonprops]

```ts
type SigninButtonProps = AuthSubmitButtonProps;
```

Props of the sign-in submit button.

***

### SignInError [#signinerror]

```ts
type SignInError = Error & object;
```

Error enriched with the HTTP status and request details of a failed sign-in.

#### Type Declaration [#type-declaration-6]

| Name | Type | Description |
| ------ | ------ | ------ |
| `code?` | `string` | Machine-readable error code. |
| `requestId?` | `string` | Request ID to quote when contacting support. |
| `retryAfterMs?` | `number` | Milliseconds to wait before retrying, when rate limited. |
| `status?` | `number` | HTTP status code of the failed request. |

***

### SigninFormForgotPasswordProps [#signinformforgotpasswordprops]

```ts
type SigninFormForgotPasswordProps<TVariant> = TouchableOpacityProps & object;
```

Props of the forgot password link.

#### Type Parameters [#type-parameters-3]

| Type Parameter | Default type |
| ------ | ------ |
| <a id="type-parameter-tvariant"></a> `TVariant` | `MD3TypescaleKey` |

#### Type Declaration [#type-declaration-7]

| Name | Type | Description |
| ------ | ------ | ------ |
| `textProps?` | `Omit`\<`TextProps`\<`TVariant`\>, `"children"`\> | Props of the link text. |

***

### SignInHeaderProps [#signinheaderprops]

```ts
type SignInHeaderProps = AuthHeaderProps;
```

Props of the sign-in header.

***

### SignInOptions [#signinoptions]

```ts
type SignInOptions =
  | {
  tenantCode: string;
  type: "Patient" | "RelatedPerson";
}
  | {
  tenantCode?: string;
  type: "Practitioner";
};
```

Profile type and tenant to sign in to.

#### Union Members [#union-members]

##### Type Literal [#type-literal]

```ts
{
  tenantCode: string;
  type: "Patient" | "RelatedPerson";
}
```

| Name | Type | Description |
| ------ | ------ | ------ |
| `tenantCode` | `string` | Tenant to sign in to. |
| `type` | `"Patient"` \| `"RelatedPerson"` | Sign in as a patient or related person. |

***

##### Type Literal [#type-literal-1]

```ts
{
  tenantCode?: string;
  type: "Practitioner";
}
```

| Name | Type | Description |
| ------ | ------ | ------ |
| `tenantCode?` | `string` | Tenant to sign in to, when applicable. |
| `type` | `"Practitioner"` | Sign in as a practitioner. |

***

### SignInProps [#signinprops]

```ts
type SignInProps = KeyboardAwareScrollViewProps;
```

Props of `SignIn`.

***

### SocialLoginsProps [#socialloginsprops]

```ts
type SocialLoginsProps = object;
```

Props of `SocialLogins`.

#### Properties [#properties-13]

##### style? [#style-1]

```ts
style?: StyleProp<ViewStyle>;
```

Style of the container.

##### testID? [#testid-3]

```ts
testID?: string;
```

Test identifier of the container.

***

### SocialSignInOptions [#socialsigninoptions]

```ts
type SocialSignInOptions =
  | {
  googleIosClientId: string;
  googleWebClientId: string;
  internalId: string;
  provider: "google";
}
  | {
  internalId: string;
  provider: "apple";
};
```

Social provider and its configuration.

#### Union Members [#union-members-1]

##### Type Literal [#type-literal-2]

```ts
{
  googleIosClientId: string;
  googleWebClientId: string;
  internalId: string;
  provider: "google";
}
```

| Name | Type | Description |
| ------ | ------ | ------ |
| `googleIosClientId` | `string` | Google OAuth client ID for iOS. |
| `googleWebClientId` | `string` | Google OAuth web client ID. |
| `internalId` | `string` | Identifier of the app the sign-in belongs to. |
| `provider` | `"google"` | Sign in with Google. |

***

##### Type Literal [#type-literal-3]

```ts
{
  internalId: string;
  provider: "apple";
}
```

| Name | Type | Description |
| ------ | ------ | ------ |
| `internalId` | `string` | Identifier of the app the sign-in belongs to. |
| `provider` | `"apple"` | Sign in with Apple. |

***

### SpacingProps [#spacingprops]

```ts
type SpacingProps = ViewProps & object;
```

Props of `Spacing`: view props plus the flex share.

#### Type Declaration [#type-declaration-8]

| Name | Type | Description |
| ------ | ------ | ------ |
| `percentage` | `number` | Flex value of the spacer. |

## Variables [#variables]

### DEFAULT\_RATE\_LIMIT\_RETRY\_MS [#default_rate_limit_retry_ms]

```ts
const DEFAULT_RATE_LIMIT_RETRY_MS: 60000 = 60_000;
```

Retry delay used when the error carries none.

***

### GOOGLE\_RETURN\_PAGE\_HTML [#google_return_page_html]

```ts
const GOOGLE_RETURN_PAGE_HTML: string;
```

The page Google returns to when `GoogleLogin` signs in on the web.

Serve it as a static file at the redirect URI, by default `/oauth/google.html`. It keeps Google's answer
for this tab and sends the tab back to the sign-in screen, so the token never stays in the address.

***

### RATE\_LIMIT\_MESSAGE\_KEY [#rate_limit_message_key]

```ts
const RATE_LIMIT_MESSAGE_KEY: "auth.rate-limit" = "auth.rate-limit";
```

Translation key of the rate limit message.
