> ## Documentation Index
> Fetch the complete documentation index at: https://iam-docs.razi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# useSignOut()

## Overview

**useSignOut** hook is used to handle the sign-out process.
It leverages the react-query library to manage the asynchronous operation and provides
error handling.

## Example Usage

```typescript sign-out-component.tsx
import { useSignOut } from '@locai1/iam-react';

const Header = () => {
  const { signOut, error } = useSignOut();

  const handleSignOut = () => {
    signOut();
  };

  return (
    <header>
      <button onClick={handleSignOut} disabled={isLoading}>
        Sign Out
      </button>
      {error && <div>{error.message}</div>}
    </header>
  );
};
```

## Returns

<ResponseField name="signOut" type="() => void">
  function that triggers the sign-out process.
</ResponseField>

<ResponseField name="isLoading" type="boolean">
  boolean indicating whether the sign-out process is currently in progress.
</ResponseField>

<ResponseField name="isError" type="boolean">
  boolean indicating whether an error occurred during the sign-out process.
</ResponseField>

<ResponseField name="error" type="HttpError | Error">
  error object if an error occurred during the sign-out process.
</ResponseField>
