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);
}
import { MiniKit } from "@worldcoin/minikit-js";
import type { MiniKitSendHapticFeedbackOptions } from "@worldcoin/minikit-js/commands";

export async function sendSelectionHaptic() {
  await MiniKit.sendHapticFeedback({
    hapticsType: "selection-changed",
  } satisfies MiniKitSendHapticFeedbackOptions);
}
type MiniKitSendHapticFeedbackOptions =
  | {
      hapticsType: "notification";
      style: "error" | "success" | "warning";
      fallback?: () => unknown;
    }
  | {
      hapticsType: "impact";
      style: "light" | "medium" | "heavy";
      fallback?: () => unknown;
    }
  | {
      hapticsType: "selection-changed";
      fallback?: () => unknown;
    };

Result

type SendHapticFeedbackResponse =
  | {
      executedWith: "minikit";
      data: {
        status: "success";
        version: number;
        timestamp: string;
      };
    }
  | {
      executedWith: "fallback";
      data: unknown;
    };
{
  "executedWith": "minikit",
  "data": {
    "status": "success",
    "version": 1,
    "timestamp": "2026-03-28T18:24:00.000Z"
  }
}

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