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: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.