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 under the hood:

Import

import { useLoginWithAbstract } from "@abstract-foundation/agw-react";

Usage

import { useLoginWithAbstract } from "@abstract-foundation/agw-react";

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

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

Returns

login
function

Opens the signup/login modal to prompt the user to connect to the application using Abstract Global Wallet.

logout
function

Disconnects the user’s wallet from the application.

Demo

View the live demo to see Abstract Global Wallet in action.

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

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