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

react-native-phone-number-hint

v0.1.3

Published

Zero-permission Android phone number hint (Google Identity API) + iOS autofill props for React Native.

Readme

react-native-phone-number-hint

CI npm license

Lightweight, permission-free phone number picker for React Native. Android uses Google's current Phone Number Hint API (Identity / play-services-auth). iOS gets autofill-friendly TextInput props. No contacts, phone, or SMS permissions. No third-party native wrappers.

A hint is not verification. After the user confirms the number, send OTP with your own auth flow.

Why this exists

Older React Native helpers wrap the deprecated credentials HintRequest API. This package calls GetPhoneNumberHintIntentRequest from Google Identity, autolinks as a TurboModule, and fails closed (null) when Play services, a SIM, or the user is missing.

Requirements

  • React Native 0.76+ (New Architecture)
  • Android minSdk 24, with Google Play services
  • iOS: no native dependency; requestPhoneNumber() returns null

Installation

npm install react-native-phone-number-hint
# or
yarn add react-native-phone-number-hint

Rebuild the native app after install (npx pod-install is not required; there is no iOS native code).

Expo

This is a native Android module. It does not run in Expo Go. Use a development build or npx expo prebuild.

Usage

import { useState } from 'react';
import { Pressable, Text, TextInput } from 'react-native';
import {
  isPhoneNumberHintAvailable,
  phoneNumberInputProps,
  requestPhoneNumber,
} from 'react-native-phone-number-hint';

export function PhoneField() {
  const [phone, setPhone] = useState('');

  const onPick = async () => {
    const selected = await requestPhoneNumber();
    if (selected) setPhone(selected);
  };

  return (
    <>
      <TextInput
        {...phoneNumberInputProps}
        value={phone}
        onChangeText={setPhone}
        placeholder="Phone number"
      />
      <Pressable onPress={onPick}>
        <Text>Use phone number on this device</Text>
      </Pressable>
    </>
  );
}

// Optional: hide the picker button when the sheet cannot be shown.
void isPhoneNumberHintAvailable();

Call requestPhoneNumber() from a user gesture (button press). Normalize the returned string for your country before sending OTP.

API

| Export | Returns | Notes | | --- | --- | --- | | requestPhoneNumber() | Promise<string \| null> | Android sheet. Concurrent JS callers share one chooser. Cancel, error, iOS, and missing Play services resolve null. | | isPhoneNumberHintAvailable() | Promise<boolean> | true on Android when an Activity is active and Play services are available. This does not guarantee a number can be selected; the request can still return null. | | phoneNumberInputProps | TextInput props | autoComplete, textContentType, keyboardType, importantForAutofill. Uses iOS name-phone-pad (for name/phone entry) and Android phone-pad. iOS does not open a chooser sheet. |

This package never sends OTPs, authenticates, persists, or logs numbers.

Troubleshooting

| Symptom | What to check | | --- | --- | | Always null on Android | Physical device or emulator with Google Play, a signed-in Google account, and a phone number on the SIM / account | | Sheet never appears | Call from a tap handler while an Activity is in the foreground; wait for the previous request to finish | | Expo Go | Use a dev client / prebuild | | Play services version | Override with rootProject.ext.playServicesAuthVersion (default 22.0.0) |

Contributing

See CONTRIBUTING.md. Please follow the code of conduct.

License

MIT © Vikram Jangid Malani