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

@michaelkhabarov/capacitor-sms-retriever

v0.2.0

Published

Capacitor plugin to retrieve SMS on Android

Readme

Capacitor SMS Retriever

Android-only plugin for Capacitor 7 that retrieves SMS messages without requiring runtime permissions. Suitable for OTP (One-Time Password) use cases using the Google Play Services SMS Retriever API.

Installation

npm install @michaelkhabarov/capacitor-sms-retriever

Platform Support

  • Android: Fully supported
  • iOS: Not supported
  • Web: Not supported

Usage

import { Capacitor } from '@capacitor/core'
import { CapacitorSmsRetriever } from "@michaelkhabarov/capacitor-sms-retriever";

if (Capacitor.getPlatform() === 'android') {
  // Start listening for SMS
  CapacitorSmsRetriever.startListening()
    .then((res) => console.log("SMS Content", res.body))
    .catch((err) => console.log("Failed", err));

  // Stop listening
  CapacitorSmsRetriever.stopListening();

  // Get signature
  CapacitorSmsRetriever.getAppSignature()
    .then((res) => { console.log("App signature", res.signature) });
}

API

startListening()

Starts listening for incoming SMS messages.

Returns: Promise<{ body: string }>

stopListening()

Stops listening for SMS messages.

getAppSignature()

This is a helper method to generate your message hash to be included in your SMS message. Without the correct hash, your app won't receive the message callback. This only needs to be generated once per app and stored.

Note: Do not use hash strings dynamically computed on the client in your verification messages.

Returns: Promise<{ signature: string }>

Requirements

  • Capacitor 7.0.0 or higher
  • Android SDK 23 (Android 6.0) or higher
  • Android Gradle Plugin 8.7.2
  • Google Play Services (play-services-auth-api-phone 18.1.0)

How It Works

This plugin uses the Google Play Services SMS Retriever API, which allows your app to automatically retrieve verification codes from SMS messages without requiring the READ_SMS permission. The SMS message must be formatted according to Google's requirements (max 140 bytes, contains a hash string identifying your app).

For more information, see the SMS Retriever API documentation.

Credits

This package is based on:

  • https://github.com/skmd87/capacitor-sms-retriever
  • https://www.npmjs.com/package/capacitor-sms-retriever#appsignature