AvaCloud API
AvaCloud App
AvaCloud Wallet as a Service
AvaCloud Wallet as a Service
  • AvaCloud Wallet as a Service SDK
  • 🚀Getting Started
    • Quickstart
  • ⚙️USAGE
    • 🪝Hooks
      • useAvaCloudWallet
      • useAuth
      • useSignMessage
      • useSignTransaction
      • useTransferTokens
      • useUserWallets
      • useChainId
    • UI Components
      • LoginButton
      • WalletButton
      • WalletDisplay
      • UserProfile
      • WalletCard
      • TokensView
      • SendView
      • ReceiveView
      • ExportView
    • 🛠️Advanced Usage
Powered by GitBook

© 2025 Ava Labs, Inc.

On this page

Was this helpful?

  1. USAGE
  2. Hooks

useAuth

Simplified hook for basic authentication state.

import { useAuth } from '@avalabs/avacloud-waas-react';

function AuthComponent() {
  const {
    isAuthenticated,
    login,
    logout
  } = useAuth();

  return (
    <div>
      {isAuthenticated ? (
        <button onClick={logout}>Logout</button>
      ) : (
        <button onClick={login}>Login</button>
      )}
    </div>
  );
}

Returns

  • isAuthenticated: boolean - Current authentication status

  • login: () => Promise - Trigger login flow

  • logout: () => Promise - Trigger logout flow

PrevioususeAvaCloudWalletNextuseSignMessage

Last updated 28 days ago

Was this helpful?

⚙️
🪝