Skip to content
AnswerWell geo Documentation

Research · 8 min read · Answerwell

Contact Picker API, Extension OAuth and Contact Sharing Controls

How websites use the Contact Picker API on Android and how Chrome extensions access Google contacts via OAuth2, Identity, and the People API.

This page summarizes Chrome for Developers documentation on two ways users can share contacts: the on-device Contact Picker API for secure websites, and OAuth 2.0 with the Chrome Identity API (and related browser.identity / chrome.identity surfaces) so extensions can reach Google contacts through the Google People API. It also covers manifest oauth2 settings, what data each path returns, and privacy controls users see in the picker.

Contact Picker API: what it is and when to use it

Section titled “Contact Picker API: what it is and when to use it”

The Contact Picker API answers the need to pick recipients or phone numbers from the device address book without building a native app.

The Contact Picker API provides an easy way for users to share contacts from their contact list.

— Google Chrome, A contact picker for the web

Available from Chrome 80 on Android M or later, the Contact Picker API spec is an on-demand API that allows users to select entries from their contact list and share limited details of the selected entries with a website. It allows users to share only what they want, when they want, and makes it easier for users to reach and connect with their friends and family.

— Google Chrome, A contact picker for the web

Typical uses include a web mail client choosing email recipients, a VoIP site choosing a number to call, or a social site helping users find friends who already joined. Use this path when the site runs in Chrome on Android and you only need fields the user explicitly selects—not a full synced contact database.

For Chrome extensions that need ongoing access to a signed-in user’s Google contacts (photos, groups, etc.), use OAuth and the People API instead; see Extension OAuth and Google contacts below.

Contact Picker API: support check and navigator.contacts.select()

Section titled “Contact Picker API: support check and navigator.contacts.select()”

Feature detection: is the Contact Picker API available?

Section titled “Feature detection: is the Contact Picker API available?”

Support is limited to environments that expose navigator.contacts and ContactsManager:

const supported = ('contacts' in navigator && 'ContactsManager' in window);

On Android, the picker also requires Android M or later, as described in A contact picker for the web.

Opening the picker: properties and multiple

Section titled “Opening the picker: properties and multiple”

The entry point is navigator.contacts.select(). It returns a promise, opens the system UI, and resolves with the contacts the user confirmed.

When calling select() you must provide an array of properties you’d like returned as the first parameter (with the allowed values being any of ‘name’, ‘email’, ‘tel’, ‘address’, or ‘icon’), and optionally whether multiple contacts can be selected as a second parameter.

— Google Chrome, A contact picker for the web

const props = ['name', 'email', 'tel', 'address', 'icon'];
const opts = { multiple: true };
try {
const contacts = await navigator.contacts.select(props, opts);
handleResults(contacts);
} catch (ex) {
// Handle any errors here.
}

getProperties(): which fields can you request?

Section titled “getProperties(): which fields can you request?”

Call navigator.contacts.getProperties() to learn which property names the device can supply (for example ['name', 'email', 'tel', 'address']), then pass those strings into select(). Properties may vary by platform or contact source, and new properties may appear over time, as noted in A contact picker for the web.

Contact Picker results: shape, empty fields and limits

Section titled “Contact Picker results: shape, empty fields and limits”

Each selected contact is an object whose keys are the requested properties; each key maps to an array of values. Missing data or user opt-out yields an empty array for that property—not omission of the key.

For example, if a site requests name, email, and tel, and a user selects a single contact that has data in the name field, provides two phone numbers, but does not have an email address, the response returned will be:

[{ "email": [], "name": ["Queen O'Hearts"], "tel": ["+1-206-555-1000", "+1-206-555-1111"] }]

— Google Chrome, A contact picker for the web

Contact Picker security: user control, transparency and no persistence

Section titled “Contact Picker security: user control, transparency and no persistence”

Chrome documents the Contact Picker around user control, transparency, and ergonomics (see Security and permissions in the same article).

User control: Access is only through the picker, only after a user gesture, in a secure top-level context—sites cannot open it on load or without context. Users pick individual contacts (no bulk “share all”), and can toggle which property types are shared even if the site requested them—for example unchecking phone numbers so tel is not sent.

Transparency: The UI shows the contact’s name and icon plus the property types the site asked for; a long-press on a contact previews what would be shared if selected.

No permission persistence:

Access to contacts is on-demand, and not persisted. Each time a site wants access, it must call navigator.contacts.select() with a user gesture, and the user must individually choose the contact(s) they want to share with the site.

— Google Chrome, A contact picker for the web

Extensions do not load like normal HTTPS sites and cannot rely on redirects and cookies the way a website does. For Google account access, Chrome documents OAuth 2.0 plus the Identity API.

OAuth2 is the industry-standard protocol for authorization. It provides a mechanism for users to grant web and desktop applications access to private information without sharing their username, password, and other private credentials.

This tutorial builds an extension that accesses a user’s Google contacts using the Google People API and the Chrome Identity API. Because extensions don’t load over HTTPS, can’t perform redirects or set cookies, they rely on the Chrome Identity API to use OAuth2.

— Google Chrome, OAuth 2.0: authenticate users with Google

The same pattern appears in the Manifest V2 article OAuth2: Authenticate users with Google, which points to the Manifest V3 guide above.

Goal Typical approach
User picks one or more device contacts once Contact Picker API (navigator.contacts.select)
Extension reads Google contact groups or profiles Manifest oauth2 + identity permission + getAuthToken + People API
Server publishes to Chrome Web Store (no user) Google Cloud service account + Chrome Web Store API (see Use a service account with the Chrome Web Store API)

Extension docs describe the same capability under both names:

Use the browser.identity API to get OAuth 2.0 access tokens.

— Google Chrome, browser.identity

Use the chrome.identity API to get OAuth2 access tokens.

— Google Chrome, chrome.identity

For new extension work, follow the Manifest V3 integration guide OAuth 2.0: authenticate users with Google and the Extensions / Develop overview.

Manifest oauth2: client ID, scopes and stable extension ID

Section titled “Manifest oauth2: client ID, scopes and stable extension ID”

Register an OAuth client (Chrome extension type in Google Cloud) and declare credentials in manifest.json:

An optional manifest key enabling the use of an OAuth 2.0 security ID on the extension. This key takes an object with two required sub-properties: “client_id” and “scopes”. When developing an extension that uses an “oauth2” key, consider also setting the extension’s “key” to keep a consistent extension ID.

— Google Chrome, Manifest - oauth2

Example with a contacts-related scope:

"oauth2": {
"client_id": "YOUR_EXTENSION_OAUTH_CLIENT_ID.apps.googleusercontent.com",
"scopes": ["https://www.googleapis.com/auth/contacts.readonly"]
},
"key": "EXTENSION_PUBLIC_KEY"

The OAuth 2.0 tutorial walks through creating a Chrome Extension OAuth client, adding permissions: ["identity"], and calling browser.identity.getAuthToken({ interactive: true }, …) to obtain a token before calling Google APIs.

For Google People API access, enable the API in Google Cloud, add https://www.googleapis.com/auth/contacts.readonly (or other required scopes) to oauth2.scopes, and call endpoints such as https://people.googleapis.com/v1/… with an Authorization: Bearer header, as shown in the same tutorial.

Identity tokens: cache, 401 responses and non-Google providers

Section titled “Identity tokens: cache, 401 responses and non-Google providers”

Legacy Chrome Apps documentation (apps are being removed; extensions remain supported) still explains Identity behavior that applies to the same OAuth surfaces:

Chrome has an in-memory cache of access tokens, so you can call getAuthToken any time you need to use a token. Token expiration is handled automatically by the cache.

You can see the current state of the token cache on chrome://identity-internals.

— Google Chrome, User Authentication

If API calls return 401 after a password change or similar, call identity.removeCachedAuthToken and retry once with a fresh token—the User Authentication article includes an authenticatedXhr example.

For non-Google identity providers, extensions use chrome.identity.launchWebAuthFlow with a redirect URL of the form https://<extension-id>.chromiumapp.org/<path>, as described in User Authentication. That is separate from the Contact Picker API, which only shares device contacts the user selects.

  1. Using the Contact Picker on desktop or non-Android Chrome without checking support—always use feature detection and degrade gracefully.
  2. Calling select() without a user gesture or from a non–top-level frame—calls will fail by design.
  3. Assuming requested properties are always returned—treat empty arrays as “not shared” or absent.
  4. Mismatching OAuth client type and extension ID when creating credentials—tokens fail if the registered application ID does not match the installed extension; the MV3 OAuth tutorial stresses using the Chrome Extension client type and correct Item ID.
  5. Forgetting identity permission or oauth2 scopes before calling getAuthToken.
  6. Confusing device contacts (picker) with Google account contacts (People API)—they are different data sources and consent models.
  1. On Chrome for Android, open a test page over HTTPS, run feature detection ('contacts' in navigator && 'ContactsManager' in window), and trigger navigator.contacts.select() from a button click; confirm the picker appears as described in A contact picker for the web.
  2. Call navigator.contacts.getProperties() and verify the returned list matches what you pass into select().
  3. After a test share, inspect the resolved objects for empty arrays when the user declines a property type.
  4. For extensions, load an unpacked build with oauth2 and identity configured per OAuth 2.0: authenticate users with Google; use getAuthToken and confirm a People API request succeeds when the API and scopes are enabled.
  5. Inspect cached identity tokens at chrome://identity-internals as documented in User Authentication; if needed, validate OAuth client setup with the OAuth 2.0 Playground flow described in Use the Chrome Web Store API.
  6. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about, and we will correct or clarify it.