Sharing contacts is a command that allows you to request users to share contacts in their phone in a privacy preserving way.
This command will be available from v1.4.0 of minikit and v2.8.72 of World App.
export type ShareContactsInput = { isMultiSelectEnabled: boolean inviteMessage?: string}
isMultiSelectEnabled is a boolean that determines if the user can select multiple contacts, by default you can only select one contact in the modal.
inviteMessage is an optional custom message that will be displayed to the user when the user invites a non world app user while inside of your mini app.
// Example function of how to use the commandconst shareContacts = useCallback( async (isMultiSelectEnabled: boolean = false, inviteMessage?: string) => { const shareContactsPayload: ShareContactsPayload = { isMultiSelectEnabled, inviteMessage, }; const payload = await MiniKit.commandsAsync.shareContacts(shareContactsPayload); // Handle the response }, []);