AutoConnect
component automatically connects to the Farcaster connector when the user is inside a Farcaster Mini App. It provides a seamless wallet connection experience without requiring manual wallet selection.
Usage
Basic setup
Wrap your app withAutoConnect
to enable automatic wallet connection in Mini Apps:
With manual control
You can disable auto-connection when needed:Advanced Usage
Combining with connection status
Layout integration
Handling connection errors
Requirements
- Farcaster Mini App environment: Must be running inside a Farcaster client
- Compatible connector: Requires a Farcaster connector (
farcasterFrame
orfarcasterMiniApp
type) - Wagmi setup: Needs proper Wagmi configuration with Farcaster connector
Behavior
- Inside Mini App with Farcaster connector: Automatically attempts connection once
- Outside Mini App: No connection attempt, renders children normally
- Already connected: Skips connection attempt
- Connection in progress: Skips additional connection attempts
- Disabled: When
enabled={false}
, behaves as a passthrough component
Props
AutoConnectProps