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-upi-launcher

v0.1.2

Published

A React Native library to launch UPI intent in app and fetch installed UPI apps on Android.

Readme

npm version npm downloads License: MIT Platform

🚀 React Native UPI Launcher

The simplest way to integrate UPI payments in your React Native Android app — Launch UPI apps (PhonePe, Google Pay, Paytm, BHIM) directly or via chooser, and fetch installed UPI apps on user's device.

Demo

✨ Why Choose react-native-upi-launcher?

  • 🎯 Direct UPI App Launch — Open specific payment apps (PhonePe, GPay, Paytm) directly
  • 🔄 Smart Fallback — Automatically shows chooser if preferred app isn't available
  • 📱 Detect Installed Apps — Get list of all UPI-enabled apps on device
  • Lightweight — Zero dependencies, minimal footprint
  • 🛡️ Type-Safe — Full TypeScript support
  • 🔌 Easy Integration — Works with React Native 0.60+ with auto-linking

📸 Screenshots

🎯 Use Cases

  • E-commerce apps — Accept UPI payments seamlessly
  • Bill payment apps — Quick utility bill settlements
  • Peer-to-peer payment apps — Send money to friends
  • Subscription services — Recurring UPI payments
  • Donation platforms — Accept contributions via UPI

📦 Installation

NPM

npm install react-native-upi-launcher

Yarn

yarn add react-native-upi-launcher

For React Native < 0.60

react-native link react-native-upi-launcher

🚀 Quick Start

1. Fetch Installed UPI Apps

import { fetchUpiApps } from "react-native-upi-launcher";

const getAvailableUpiApps = async () => {
  try {
    const apps = await fetchUpiApps();
    console.log("Available UPI apps:", apps);
    /*
    Output example:
    [
      { packageName: "com.phonepe.app", appName: "PhonePe" },
      { packageName: "com.google.android.apps.nbu.paisa.user", appName: "Google Pay" },
      { packageName: "net.one97.paytm", appName: "Paytm" }
    ]
    */
  } catch (error) {
    console.error("Error fetching UPI apps:", error);
  }
};

2. Launch UPI Payment Intent

import { openUpiIntent } from "react-native-upi-launcher";

const makePayment = async () => {
  const upiUrl =
    "upi://pay?pa=merchant@upi&pn=Merchant%20Name&am=100&cu=INR&tn=Order%20Payment";
  const preferredApp = "com.phonepe.app"; // Optional: specific UPI app package

  try {
    const result = await openUpiIntent(upiUrl, preferredApp);
    console.log("Payment initiated:", result);
  } catch (error) {
    console.error("Payment failed:", error);
  }
};

3. Complete Example with Error Handling

import React, { useState, useEffect } from "react";
import { View, Button, FlatList, Text, Alert } from "react-native";
import { fetchUpiApps, openUpiIntent } from "react-native-upi-launcher";

const PaymentScreen = () => {
  const [upiApps, setUpiApps] = useState([]);

  useEffect(() => {
    loadUpiApps();
  }, []);

  const loadUpiApps = async () => {
    try {
      const apps = await fetchUpiApps();
      setUpiApps(apps);
    } catch (error) {
      Alert.alert("Error", "Failed to load UPI apps");
    }
  };

  const initiatePayment = async (packageName) => {
    const upiUrl =
      "upi://pay?pa=test@upi&pn=Test%20User&am=1&cu=INR&tn=Test%20Payment";

    try {
      await openUpiIntent(upiUrl, packageName);
      Alert.alert("Success", "Payment initiated successfully");
    } catch (error) {
      Alert.alert("Error", "Payment failed: " + error.message);
    }
  };

  return (
    <View>
      <FlatList
        data={upiApps}
        keyExtractor={(item) => item.packageName}
        renderItem={({ item }) => (
          <Button
            title={`Pay with ${item.appName}`}
            onPress={() => initiatePayment(item.packageName)}
          />
        )}
      />
    </View>
  );
};

export default PaymentScreen;

📋 API Reference

fetchUpiApps(): Promise<UpiApp[]>

Fetches all installed UPI applications on the device.

Returns: Array of UPI app objects

interface UpiApp {
  packageName: string; // e.g., "com.phonepe.app"
  appName: string; // e.g., "PhonePe"
}

openUpiIntent(upiUrl: string, packageName?: string): Promise<void>

Launches UPI payment intent.

Parameters:

  • upiUrl (required): UPI payment URL string
  • packageName (optional): Specific UPI app package name. If omitted or app not found, shows chooser.

UPI URL Format:

upi://pay?pa=<UPI_ID>&pn=<NAME>&am=<AMOUNT>&cu=<CURRENCY>&tn=<NOTE>

Parameters:

  • pa — Payee UPI address (required)
  • pn — Payee name (required)
  • am — Amount (optional)
  • cu — Currency (default: INR)
  • tn — Transaction note (optional)

📱 Popular UPI App Package Names

| App | Package Name | | -------------- | ---------------------------------------- | | PhonePe | com.phonepe.app | | Google Pay | com.google.android.apps.nbu.paisa.user | | Paytm | net.one97.paytm | | BHIM | in.org.npci.upiapp | | Amazon Pay | in.amazon.mShop.android.shopping | | WhatsApp | com.whatsapp | | Mobikwik | com.mobikwik_new | | Freecharge | com.freecharge.android |

⚙️ Configuration

Adding Support for Additional UPI Apps

If you need to support UPI apps beyond the default list, add their package names to your AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.yourapp">

    <queries>
        <!-- Default UPI apps (already included in library) -->
        <package android:name="com.phonepe.app" />
        <package android:name="com.google.android.apps.nbu.paisa.user" />
        <package android:name="net.one97.paytm" />
        <package android:name="in.org.npci.upiapp" />

        <!-- Add your custom UPI apps here -->
        <package android:name="com.mybank.upi" />
        <package android:name="com.customwallet.app" />
    </queries>

    <application>
        <!-- Your app configuration -->
    </application>
</manifest>

Note: For Android 11+ (API 30+), you must declare package visibility queries in your manifest for apps you want to detect.

🔧 Troubleshooting

Common Issues

1. No UPI apps detected

  • Ensure UPI apps are installed on the device
  • Check AndroidManifest.xml has proper <queries> declarations
  • Verify targetSdkVersion is 30 or higher

2. App chooser not showing

  • Verify the UPI URL format is correct
  • Check that at least one UPI app is installed
  • Ensure proper permissions in AndroidManifest

3. Payment not initiating

  • Validate UPI URL parameters
  • Check network connectivity
  • Verify UPI app is up to date

🍎 iOS Support

On iOS, the library falls back to using React Native's Linking.openURL() to open UPI deep links. However, iOS has limited native UPI support compared to Android.

import { Linking, Platform } from "react-native";
import { openUpiIntent } from "react-native-upi-launcher";

const handlePayment = async (upiUrl) => {
  if (Platform.OS === "ios") {
    // iOS fallback
    await Linking.openURL(upiUrl);
  } else {
    // Android - full functionality
    await openUpiIntent(upiUrl);
  }
};

🔐 Security Best Practices

  • ✅ Always validate UPI URLs on your backend
  • ✅ Never hardcode sensitive payment information
  • ✅ Implement proper error handling
  • ✅ Verify transaction status via server callbacks
  • ✅ Use HTTPS for all API communications
  • ✅ Sanitize user inputs before creating UPI URLs

🧪 Testing

Test with these sample UPI URLs:

// Test payment (will fail gracefully)
const testUrl =
  "upi://pay?pa=test@paytm&pn=Test%20Merchant&am=1&cu=INR&tn=Test";

// Use your own UPI ID for testing
const realUrl = "upi://pay?pa=yourname@paytm&pn=Your%20Name&am=10&cu=INR";

📊 Performance

  • Bundle size: < 15KB
  • No external dependencies
  • Native Android implementation for optimal performance
  • Async/await support for modern JavaScript

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

See detailed development workflow guide.

📝 Code of Conduct

Please read our Code of Conduct before contributing.

📄 License

MIT © Vivek Negi

See LICENSE file for details.

🙏 Acknowledgments

🔗 Links

📈 Stats

GitHub stars GitHub forks


Keywords: react-native, upi, payment, phonepe, gpay, paytm, bhim, android, upi-payment, react-native-payments, indian-payments, upi-integration, mobile-payments, digital-payments, upi-launcher

Made with ❤️ for the React Native community