MiniKit.chat() to open World Chat with a prefilled message.
Commands
World Chat
Share a message through World Chat using the unified MiniKit API.
Use
Was this page helpful?
Documentation Index
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() to open World Chat with a prefilled message.
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"
}
}
| Code | Meaning |
|---|---|
user_rejected | The user rejected the request |
send_failed | Sending the message failed |
generic_error | Unexpected failure |
Was this page helpful?