Skip to content

addMiniApp

Prompts the user to add the app.

adding a mini app in Warpcast

A user discovers an app from their social feed, adds it, and then sees it from their apps screen

Usage

import { sdk } from '@farcaster/miniapp-sdk'
 
await sdk.actions.addMiniApp()

The addMiniApp() action requires your app's domain to exactly match the domain in your manifest file. This means:

  • You cannot use tunnel domains (ngrok, localtunnel, etc.) - the action will fail
  • Your app must be deployed to the same domain specified in your farcaster.json
  • For local development, use the preview tool instead of trying to add the app

Return Value

void

Errors

RejectedByUser

Thrown if a user rejects the request to add the Mini App.

InvalidDomainManifestJson

Thrown when an app does not have a valid farcaster.json or when the domain doesn't match. Common causes:

  • Using a tunnel domain (ngrok, localtunnel) instead of your production domain
  • The app's current domain doesn't match the domain in the manifest
  • The manifest file is missing or malformed