MiniKit is the official SDK for building Mini Apps that work seamlessly across Base App and other Farcaster clients. It provides React hooks, context management, and wallet integration that eliminates the complexity of building social-native applications.

Why MiniKit?

Seamless Integration

Works with OnchainKit for complete onchain app development with shared providers and configuration.

Social-Native

Built specifically for Farcaster’s frame-based architecture with native social features.

Wallet Abstraction

Simplified wallet connections and transaction flows with automatic provider detection.

Cross-Client

Works across Base App, Farcaster, and other clients with consistent behavior.

Architecture

MiniKit consists of three main components:

MiniKitProvider

React context provider that configures:
  • Wagmi and react-query setup
  • Chain and API key configuration
  • Theme and appearance settings
  • Farcaster connector integration

Hooks

React hooks for frame interactions:
  • Frame Management: useMiniKit, useAddFrame, useClose
  • Navigation: useOpenUrl, useViewProfile, useViewCast
  • Social: useComposeCast, useNotification
  • Authentication: useAuthenticate
  • UI: usePrimaryButton

CLI Tools

Command-line utilities for:
  • Project scaffolding with npx create-onchain --mini
  • Manifest generation with npx create-onchain --manifest
  • Development workflow automation

Getting Started

Key Concepts

Frame Lifecycle

Mini Apps run within Farcaster frames and must signal readiness:
  1. Initialize MiniKitProvider in your app root
  2. Signal readiness with setFrameReady() in your main component
  3. Handle interactions through MiniKit hooks

Context vs Authentication

  • Context data (useMiniKit().context) provides user info but can be spoofed
  • Authentication (useAuthenticate()) provides cryptographically verified user identity
  • Always use authentication for security-critical operations

Cross-Client Compatibility

MiniKit automatically detects the client environment and adapts:
  • Base App: Native wallet integration, enhanced features
  • Farcaster: Standard Farcaster protocol compliance
  • Other clients: Graceful fallbacks and compatibility modes

Technical Reference