npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ethion/capacitor-contacts

v8.0.0

Published

Capacitor plugin for accessing native contacts on iOS and Android

Readme

@ethion/capacitor-contacts

Capacitor Plugin for accessing native Contacts on iOS and Android.

npm npm

Features

  • Read contacts from the device's address book
  • Create contacts with full field support
  • Delete contacts by ID
  • Pick contacts using native UI picker
  • Permission management with check and request methods
  • Capacitor 6, 7, and 8 support
  • Swift Package Manager (SPM) support for iOS
  • CocoaPods support for iOS

Installation

npm install @ethion/capacitor-contacts
npx cap sync

Requirements

iOS

  • iOS 15.0+ deployment target
  • Xcode 15.0+
  • Swift 5.9+

Android

  • minSdk 24 (Android 7.0+)
  • targetSdk 36
  • Java 21

Setup

iOS

Add the following to your Info.plist:

<key>NSContactsUsageDescription</key>
<string>We need access to your contacts to...</string>

Accessing notes in contact entries

To access notes in contact entries on iOS 13+, your app must have the com.apple.developer.contacts.notes entitlement. See Apple's documentation.

Android

Add the following permissions to your AndroidManifest.xml:

<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />

Quick Start

import { Contacts } from '@ethion/capacitor-contacts';

// Check permissions
const checkPermissions = async () => {
  const status = await Contacts.checkPermissions();
  console.log('Permission status:', status.contacts);
};

// Request permissions
const requestPermissions = async () => {
  const status = await Contacts.requestPermissions();
  console.log('Permission status:', status.contacts);
};

// Get all contacts
const getContacts = async () => {
  const result = await Contacts.getContacts({
    projection: {
      name: true,
      phones: true,
      emails: true,
    },
  });
  console.log('Contacts:', result.contacts);
};

// Create a contact
const createContact = async () => {
  const result = await Contacts.createContact({
    contact: {
      name: {
        given: 'John',
        family: 'Doe',
      },
      phones: [
        {
          type: 'mobile',
          number: '+1234567890',
        },
      ],
    },
  });
  console.log('Created contact ID:', result.contactId);
};

// Delete a contact
const deleteContact = async (contactId: string) => {
  await Contacts.deleteContact({ contactId });
};

// Pick a contact using native UI
const pickContact = async () => {
  const result = await Contacts.pickContact({
    projection: {
      name: true,
      phones: true,
    },
  });
  console.log('Picked contact:', result.contact);
};

API Reference

Methods

| Method | Description | |--------|-------------| | checkPermissions() | Check current permission status | | requestPermissions() | Request contacts permission | | getContact(options) | Get a single contact by ID | | getContacts(options) | Get all contacts matching projection | | createContact(options) | Create a new contact | | deleteContact(options) | Delete a contact by ID | | pickContact(options) | Open native contact picker |

Projection

Use projection to specify which contact fields to retrieve:

interface Projection {
  name?: boolean;        // Contact name fields
  organization?: boolean; // Company, job title, department
  birthday?: boolean;    // Birthday date
  note?: boolean;        // Contact notes
  phones?: boolean;      // Phone numbers
  emails?: boolean;      // Email addresses
  urls?: boolean;        // Website URLs
  postalAddresses?: boolean; // Physical addresses
  image?: boolean;       // Contact photo (base64)
}

Types

The plugin exports the following types:

  • PhoneType - Phone number types (home, work, mobile, etc.)
  • EmailType - Email types (home, work, etc.)
  • PostalAddressType - Address types (home, work, etc.)
  • ContactPayload - Contact data structure
  • NamePayload, PhonePayload, EmailPayload, PostalAddressPayload, etc.

Breaking Changes in v8

  • iOS: Requires iOS 15.0+ deployment target
  • iOS: Full Swift Package Manager (SPM) support added
  • Android: Requires minSdk 24, targetSdk/compileSdk 36
  • Android: Gradle updated to 8.13.0, Gradle Wrapper to 8.14.3
  • Node.js: Requires Node.js 22+ for Capacitor 8

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request at github.com/ethion-cloud/capacitor-contacts.