Skip to main content
The SignInWithBaseButton is a ready-to-use React component that provides a seamless authentication experience using Base Account. It handles the entire sign-in flow including wallet connection, message signing, and user authentication.
Please Follow the brand guidelinesIf you intend on using the SignInWithBaseButton, please follow the Brand Guidelines to ensure consistency across your application.

Installation

Basic Usage

Props

Styling Props

'left' | 'center' | 'right'
Button alignment within its container (default: ‘left’)
'solid' | 'transparent'
Button variant style (default: ‘solid’)
'light' | 'dark' | 'system'
Color scheme for the button appearance (default: ‘system’)
'small' | 'medium' | 'large'
Button size (default: ‘medium’)
boolean
Whether the button is disabled (default: false)

Event Handlers

function
Callback function called when the button is clicked
function
Callback function called when authentication completes (success or failure)

Styling Options

Alignment

Variants

Color Schemes

Sizes

Authentication Flow Integration

Complete Authentication Example

SIWE Integration

Custom Button States

Loading State

Error State Handling

Integration with Authentication Providers

NextAuth.js Integration

TypeScript Support

Best Practices

  1. Handle Loading States: Disable the button during authentication to prevent multiple attempts
  2. Error Handling: Provide clear error messages for different failure scenarios
  3. Security: Always verify signatures on your backend before trusting authentication
  4. User Experience: Show clear feedback during the authentication process
  5. Accessibility: The button includes proper ARIA labels and keyboard navigation
  6. Testing: Test with different wallet states (connected, disconnected, etc.)
The SignInWithBaseButton provides a complete, production-ready authentication solution that handles all the complexity of wallet-based authentication while providing a familiar user experience.