Skip to main content
Back to plugins
@capgo/capacitor-contacts
Tutorial
by github.com/Cap-go

Contacts

Access and manage device contacts with read and write capabilities

Guide

Tutorial on Contacts

Using @capgo/capacitor-contacts

Capacitor Contacts Plugin interface for managing device contacts.

Install

bun add @capgo/capacitor-contacts
bunx cap sync

What This Plugin Exposes

  • countContacts - Count the total number of contacts on the device.
  • createContact - Create a new contact programmatically.
  • createGroup - Create a new contact group.
  • deleteContactById - Delete a contact by ID.

Example Usage

countContacts

Count the total number of contacts on the device.

import { CapacitorContacts } from '@capgo/capacitor-contacts';

await CapacitorContacts.countContacts();

createContact

Create a new contact programmatically.

import { CapacitorContacts } from '@capgo/capacitor-contacts';

await CapacitorContacts.createContact({} as CreateContactOptions);

createGroup

Create a new contact group.

import { CapacitorContacts } from '@capgo/capacitor-contacts';

await CapacitorContacts.createGroup({} as CreateGroupOptions);

deleteContactById

Delete a contact by ID.

import { CapacitorContacts } from '@capgo/capacitor-contacts';

await CapacitorContacts.deleteContactById({} as DeleteContactByIdOptions);

Full Reference