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

otpless-react-native-autoread

v1.0.0

Published

OTPLESS OTP auto-read (WhatsApp + SMS) SDK for React Native.

Readme

OTPLESS React Native auto-read SDK

A focused SDK for OTP auto-read only: WhatsApp zero-tap and SMS Retriever-based auto-read, with no dependency on the rest of the OTPLESS headless auth flow. If you need full phone-auth (OTP send/verify, one-tap, MFA, SNA, etc.), use otpless-headless-rn-lite instead — that SDK already includes this functionality internally.

Platform support

  • Android: minSdk 21 (WhatsApp zero-tap requires Android 7.0 / API 24+). Wraps io.github.otpless-tech:otpless-autoread-sdk directly. No manifest changes needed — the vendor AAR's own manifest merges in the required <queries> entries for WhatsApp/WhatsApp Business and its BroadcastReceiver.
  • iOS: not supported. WhatsApp zero-tap and the SMS Retriever API are Android-only concepts; there is no OTPLESS auto-read vendor SDK for iOS. Every method is a safe no-op on iOS — start* methods immediately emit a result with error: "UNSUPPORTED_PLATFORM" on the same event channel Android uses (so your callback logic can stay platform-agnostic), and stop* methods do nothing.

Installation

npm i otpless-react-native-autoread

Usage

import { OtplessAutoReadModule } from 'otpless-react-native-autoread';

const autoRead = new OtplessAutoReadModule();

useEffect(() => {
  autoRead.setResultCallback(onAutoReadResult);
  autoRead.startAutoRead(); // or startWhatsappAutoRead() / startSMSAutoRead()
  return () => {
    autoRead.stopAutoRead();
    autoRead.clearListener();
  };
}, []);

const onAutoReadResult = (result) => {
  // result: { success, source: 'SMS' | 'WHATSAPP_CONSUMER' | 'WHATSAPP_BUSINESS', otp?, sender?, error? }
  if (result.success) {
    console.log(`OTP ${result.otp} via ${result.source}`);
  }
};

API reference

| Method | Platforms | Description | | --- | --- | --- | | setResultCallback(callback) | Android, iOS | Subscribes to auto-read results. Call before starting any start* method. | | clearListener() | Android, iOS | Unsubscribes the result callback. | | startAutoRead() | Android, iOS (no-op) | Starts both WhatsApp zero-tap and SMS Retriever auto-read. | | startWhatsappAutoRead() | Android (API 24+), iOS (no-op) | Starts WhatsApp zero-tap auto-read only. | | startSMSAutoRead() | Android, iOS (no-op) | Starts SMS Retriever-based auto-read only. | | stopAutoRead() | Android, iOS (no-op) | Stops both — see the WhatsApp limitation below. | | stopWhatsappAutoRead() | Android (best-effort), iOS (no-op) | See Known limitation below. | | stopSMSAutoRead() | Android, iOS (no-op) | Fully unregisters the SMS Retriever receiver. |

Result shape

interface AutoReadResult {
  success: boolean;
  source: 'SMS' | 'WHATSAPP_CONSUMER' | 'WHATSAPP_BUSINESS';
  otp?: string;
  sender?: string; // SMS originating address, when available
  subscriptionId?: number; // SIM subscription ID the SMS was received on, when available
  error?: string;
}

Known limitation: stopWhatsappAutoRead() is best-effort

The underlying vendor SDK (otpless-autoread-sdk) registers WhatsApp zero-tap as a statically manifest-declared BroadcastReceiver and exposes no public API to unregister it — this was confirmed by decompiling the SDK's own AAR, and matches how OTPLESS's own headless SDK uses it internally (it never unregisters WhatsApp zero-tap either, only SMS).

As a result:

  • stopSMSAutoRead() genuinely unregisters the SMS Retriever receiver (AutoReadSDK.unregisterSmsOtpReceiver()), matching vendor behavior.
  • stopWhatsappAutoRead() only stops this module from forwarding further WhatsApp results to your JS callback. The native BroadcastReceiver keeps listening for WhatsApp's com.whatsapp.otp.OTP_RETRIEVED broadcast at the OS level for the lifetime of your process — there is currently no way to fully unregister it.

If you need guaranteed full teardown of WhatsApp auto-read, that requires a change in the vendor SDK itself.

Example app

The example/ app is a minimal QA harness with two tabs:

  • Controls: buttons for all 6 start/stop functions.
  • Log: a color-coded, expandable event feed for every call and result, with copy-to-clipboard support.

Author

OTPLESS, [email protected]

react-native-autoread