Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Hooks

React hooks for authentication, wallet management, and UI control.

Authentication

HookDescription
useUserCurrent user and access token
useEmailAuthEmail/password authentication
useEmailOtpAuthEmail OTP (passwordless) authentication
usePhoneOtpAuthPhone OTP (SMS) authentication
useOAuthOAuth provider authentication
useGuestAuthGuest authentication
useWalletAuthSIWE wallet authentication
useConnectWithSiweSIWE authentication after wallet connection
useAuthCallbackOAuth and email verification callbacks
useSignOutSign out and clear session

Wallets

HookDescription
useWalletsWallet management and switching
useWalletAssetsWallet token balances

Permissions

HookDescription
useGrantPermissionsGrant session key permissions (EIP-7715)
useRevokePermissionsRevoke session key permissions
use7702AuthorizationSign EIP-7702 authorizations

UI

HookDescription
useUIModal control and navigation

Utility

HookDescription
useChainsAccess configured blockchain chains
useChainIsSupportedCheck if a chain ID is supported

useChains

Access all blockchain chains configured in the Wagmi config.

import { useChains } from '@openfort/react';
 
function ChainSelector() {
  const chains = useChains();
 
  return (
    <select>
      {chains.map(chain => (
        <option key={chain.id} value={chain.id}>
          {chain.name}
        </option>
      ))}
    </select>
  );
}

useChainIsSupported

Check if a specific chain ID is supported in the current configuration.

import { useChainIsSupported } from '@openfort/react';
 
function ChainStatus({ chainId }: { chainId?: number }) {
  const isSupported = useChainIsSupported(chainId);
 
  return <span>{isSupported ? 'Supported' : 'Unsupported'}</span>;
}
Copyright © 2023-present Alamas Labs, Inc