Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Share a message through World Chat using the unified MiniKit API.
MiniKit.chat()
import { MiniKit } from "@worldcoin/minikit-js"; import type { CommandResultByVia, MiniAppChatSuccessPayload, MiniKitChatOptions, } from "@worldcoin/minikit-js/commands"; export async function shareToChat() { const input = { message: "Check out this mini app", to: ["andy"], } satisfies MiniKitChatOptions; const result: CommandResultByVia< MiniAppChatSuccessPayload, MiniAppChatSuccessPayload, "minikit" > = await MiniKit.chat(input); console.log(result.data.count); }
type MiniKitChatOptions = { message: string; to?: string[]; fallback?: () => unknown; };
type ChatResponse = | { executedWith: "minikit"; data: { status: "success"; version: number; count: number; timestamp: string; }; } | { executedWith: "fallback"; data: unknown; };
{ "executedWith": "minikit", "data": { "status": "success", "version": 1, "count": 2, "timestamp": "2026-03-28T18:24:00.000Z" } }
user_rejected
send_failed
generic_error
Was this page helpful?