MiniKit.shareContacts() to open the World App contact picker. The getContacts export from @worldcoin/minikit-js/commands is a legacy alias; call MiniKit.shareContacts() instead, since the standalone export never receives World App’s response.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Open the native contact picker using the unified MiniKit API.
MiniKit.shareContacts() to open the World App contact picker. The getContacts export from @worldcoin/minikit-js/commands is a legacy alias; call MiniKit.shareContacts() instead, since the standalone export never receives World App’s response.
import { MiniKit } from "@worldcoin/minikit-js";
import type {
CommandResultByVia,
MiniKitShareContactsOptions,
ShareContactsResult,
} from "@worldcoin/minikit-js/commands";
export async function pickContacts() {
const input = {
isMultiSelectEnabled: true,
inviteMessage: "Join me in this mini app",
} satisfies MiniKitShareContactsOptions;
const result: CommandResultByVia<
ShareContactsResult,
ShareContactsResult,
"minikit"
> = await MiniKit.shareContacts(input);
console.log(result.data.contacts);
}
type MiniKitShareContactsOptions = {
isMultiSelectEnabled?: boolean;
inviteMessage?: string;
fallback?: () => unknown;
};
type ShareContactsResponse =
| {
executedWith: "minikit";
data: {
contacts: Array<{
username: string;
walletAddress: string;
profilePictureUrl: string | null;
}>;
timestamp: string;
};
}
| {
executedWith: "fallback";
data: unknown;
};
{
"executedWith": "minikit",
"data": {
"contacts": [
{
"username": "alex",
"walletAddress": "0x1234567890123456789012345678901234567890",
"profilePictureUrl": "https://cdn.example.com/profile/alex.png"
}
],
"timestamp": "2026-03-28T18:24:00.000Z"
}
}
| Code | Meaning |
|---|---|
user_rejected | The user rejected the request |
generic_error | Unexpected failure |
Was this page helpful?