Skip to main content
Use MiniKit.sendHapticFeedback() to trigger native haptic feedback.

Haptic Types

  • "notification" — style: "success", "warning", or "error"
  • "impact" — style: "light", "medium", or "heavy"
  • "selection-changed" — no style needed

Basic Usage

import { MiniKit } from "@worldcoin/minikit-js";
import type { MiniKitSendHapticFeedbackOptions } from "@worldcoin/minikit-js/commands";

export async function sendImpactHaptic() {
  await MiniKit.sendHapticFeedback({
    hapticsType: "impact",
    style: "medium",
  } satisfies MiniKitSendHapticFeedbackOptions);
}

Result

type SendHapticFeedbackResponse =
  | {
      executedWith: "minikit";
      data: {
        status: "success";
        version: number;
        timestamp: string;
      };
    }
  | {
      executedWith: "fallback";
      data: unknown;
    };

Fallback Behavior

Define a custom fallback in the command payload for support outside mini apps.

Error Codes

CodeMeaning
generic_errorUnexpected failure
user_rejectedThe request was rejected