Skip to main content
Defined in @coinbase/onchainkit
The Add Frame feature is not yet available in Base App but is coming soon. This documentation describes the upcoming API that will be available when the feature is fully deployed.
Enables users to save your Mini App to their personal collection for quick access. Returns notification credentials when successful, enabling future push notifications to re-engage the user.

Returns

() => Promise<AddFrameResult | null>
Function that triggers the add frame flow. Returns a promise that resolves when the user completes the action.

Usage Patterns

Database Storage

Always save the notification token to your database for future use:
pages/api/notification-tokens.ts

Strategic Timing

Prompt users to save at high-value moments:
  • βœ… After achievements: Completing a game, reaching a milestone
  • βœ… After successful transactions: Minting an NFT, making a purchase
  • βœ… During onboarding: After showing app value
  • ❌ Immediately on load: Before demonstrating value
  • ❌ Multiple times: Respect user’s previous decision

Error Handling

Handle various outcomes gracefully:
The notification token is unique per user and Mini App combination. Store it securely in your database and never expose it in client-side code. Tokens are required for sending push notifications when that feature becomes available.
Users can only save each Mini App once. Subsequent calls to addFrame() for the same user and app will return null. Use context.client.added from useMiniKit to check if the user has already saved your app.