Skip to main content

Components

Pre-built UI components for authentication and wallet management.

SignIn

Authentication component with support for email, passkey, and external wallet auth.

Basic Usage

import { SignIn } from '@agentfish/react';

// Shows a sign-in button that opens a modal
<SignIn
providers={['email', 'passkey', 'wallet']}
onSuccess={(wallet) => console.log('Authenticated!', wallet.address)}
onError={(error) => console.error(error)}
/>

Controlled Mode

Control the modal state with your own button:

import { SignIn } from '@agentfish/react';
import { useState } from 'react';

function MyComponent() {
const [isOpen, setIsOpen] = useState(false);

return (
<>
<button onClick={() => setIsOpen(true)}>
Sign In
</button>
<SignIn
isOpen={isOpen}
onOpenChange={setIsOpen}
providers={['email', 'wallet']}
onSuccess={(wallet) => console.log('Authenticated!')}
/>
</>
);
}

Props

PropTypeDefaultDescription
providers('email' | 'passkey' | 'wallet')[]['email', 'passkey', 'wallet']Auth methods to show
isOpenboolean-Controlled mode: modal open state
onOpenChange(open: boolean) => void-Controlled mode: state change handler
onSuccess(wallet: Wallet) => void-Called on successful auth
onError(error: Error) => void-Called on auth error
classNamestring-Custom class for trigger button

WalletButton

Displays wallet info with a dropdown for balance, address, and actions.

Basic Usage

import { WalletButton } from '@agentfish/react';

<WalletButton />

Variants

// Full button with balance
<WalletButton variant="full" showBalance={true} />

// Compact button
<WalletButton variant="compact" />

// Icon only
<WalletButton variant="icon-only" />

Props

PropTypeDefaultDescription
variant'full' | 'compact' | 'icon-only''full'Button style
showBalancebooleantrueShow balance in button
dropdownAlign'left' | 'right''right'Dropdown alignment
dropdownDirection'up' | 'down''down'Dropdown direction
onAddFunds() => void-Callback when add funds clicked
onDisconnect() => void-Callback on disconnect

AddFundsModal

QR code modal for funding the wallet.

import { AddFundsModal } from '@agentfish/react';
import { useState } from 'react';
import { useWallet } from '@agentfish/react';

function FundWallet() {
const [isOpen, setIsOpen] = useState(false);
const { address } = useWallet();

return (
<>
<button onClick={() => setIsOpen(true)}>
Add Funds
</button>
<AddFundsModal
isOpen={isOpen}
onClose={() => setIsOpen(false)}
address={address!}
/>
</>
);
}

Props

PropTypeRequiredDescription
isOpenbooleanYesModal open state
onClose() => voidYesClose handler
addressstringYesWallet address for QR code

Supported Wallets

External Wallet Auth

The SDK automatically detects installed wallets:

Solana:

  • Phantom
  • Solflare

EVM:

  • MetaMask
  • Coinbase Wallet