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

# useLoginWithAbstract

> Hook for signing in and signing out users with Abstract Global Wallet.

Use the `useLoginWithAbstract` hook to prompt users to sign up or sign into your application using Abstract Global Wallet
and optionally sign out once connected.

It uses the following hooks from [wagmi](https://wagmi.sh/) under the hood:

* `login`: [useConnect](https://wagmi.sh/react/api/hooks/useConnect).
* `logout`: [useDisconnect](https://wagmi.sh/react/api/hooks/useDisconnect).

## Import

```tsx theme={null}
import { useLoginWithAbstract } from "@abstract-foundation/agw-react";
```

## Usage

```tsx theme={null}
import { useLoginWithAbstract } from "@abstract-foundation/agw-react";

export default function App() {
  const { login, logout } = useLoginWithAbstract();

  return <button onClick={login}>Login with Abstract</button>;
}
```

## Returns

<ResponseField name="login" type="function">
  Opens the signup/login modal to prompt the user to connect to the application
  using Abstract Global Wallet.
</ResponseField>

<ResponseField name="logout" type="function">
  Disconnects the user's wallet from the application.
</ResponseField>

## Demo

View the [live demo](https://sdk.demos.abs.xyz) to see Abstract Global Wallet in action.

If the user does not have an Abstract Global Wallet, they will be prompted to create one:

<img className="block dark:hidden" src="https://mintcdn.com/abstract/jrt2MBQQLuqZic7X/images/agw-signup-2.gif?s=e75126fc664e8d70eb956a4afcd29035" alt="Abstract Global Wallet with useLoginWithAbstract Light" width="1315" height="763" data-path="images/agw-signup-2.gif" />

<img className="hidden dark:block" src="https://mintcdn.com/abstract/jrt2MBQQLuqZic7X/images/agw-signup-2.gif?s=e75126fc664e8d70eb956a4afcd29035" alt="Abstract Global Wallet with useLoginWithAbstract Dark" width="1315" height="763" data-path="images/agw-signup-2.gif" />

If the user already has an Abstract Global Wallet, they will be prompted to use it to sign in:

<img className="block dark:hidden" src="https://mintcdn.com/abstract/jrt2MBQQLuqZic7X/images/agw-signin.gif?s=8eebdda74329a822ff6df1d2a5506251" alt="Abstract Global Wallet with useLoginWithAbstract Light" width="1254" height="743" data-path="images/agw-signin.gif" />

<img className="hidden dark:block" src="https://mintcdn.com/abstract/jrt2MBQQLuqZic7X/images/agw-signin.gif?s=8eebdda74329a822ff6df1d2a5506251" alt="Abstract Global Wallet with useLoginWithAbstract Dark" width="1254" height="743" data-path="images/agw-signin.gif" />
