{"id":35324505,"url":"https://github.com/vivnegi21/react-native-upi-launcher","last_synced_at":"2026-04-10T12:31:15.224Z","repository":{"id":325603055,"uuid":"1101781174","full_name":"vivnegi21/react-native-upi-launcher","owner":"vivnegi21","description":"A React Native library to launch UPI intent in app and fetch installed UPI apps on Android.","archived":false,"fork":false,"pushed_at":"2025-11-22T10:25:11.000Z","size":1755,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-03T22:37:35.050Z","etag":null,"topics":["inapp-upi","java","javascript","native","payment-gateway","react-native","react-native-android","react-native-library","typescript","upi","upi-integration","upi-intent","upi-intent-flow","upi-payment"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-upi-launcher","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vivnegi21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-22T08:16:11.000Z","updated_at":"2025-11-22T10:26:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vivnegi21/react-native-upi-launcher","commit_stats":null,"previous_names":["vivnegi21/react-native-upi-launcher"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/vivnegi21/react-native-upi-launcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivnegi21%2Freact-native-upi-launcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivnegi21%2Freact-native-upi-launcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivnegi21%2Freact-native-upi-launcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivnegi21%2Freact-native-upi-launcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vivnegi21","download_url":"https://codeload.github.com/vivnegi21/react-native-upi-launcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivnegi21%2Freact-native-upi-launcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31642664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["inapp-upi","java","javascript","native","payment-gateway","react-native","react-native-android","react-native-library","typescript","upi","upi-integration","upi-intent","upi-intent-flow","upi-payment"],"created_at":"2025-12-31T01:05:59.183Z","updated_at":"2026-04-10T12:31:15.199Z","avatar_url":"https://github.com/vivnegi21.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://img.shields.io/npm/v/react-native-upi-launcher)](https://www.npmjs.com/package/react-native-upi-launcher)\n[![npm downloads](https://img.shields.io/npm/dm/react-native-upi-launcher)](https://www.npmjs.com/package/react-native-upi-launcher)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Platform](https://img.shields.io/badge/platform-Android-green.svg)](https://www.android.com)\n\n# 🚀 React Native UPI Launcher\n\n**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.\n\n![Demo](demo.gif)\n\n## ✨ Why Choose react-native-upi-launcher?\n\n- 🎯 **Direct UPI App Launch** — Open specific payment apps (PhonePe, GPay, Paytm) directly\n- 🔄 **Smart Fallback** — Automatically shows chooser if preferred app isn't available\n- 📱 **Detect Installed Apps** — Get list of all UPI-enabled apps on device\n- ⚡ **Lightweight** — Zero dependencies, minimal footprint\n- 🛡️ **Type-Safe** — Full TypeScript support\n- 🔌 **Easy Integration** — Works with React Native 0.60+ with auto-linking\n\n## 📸 Screenshots\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"screenshot1.png\" alt=\"UPI App Selection\" width=\"250\"/\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"screenshot2.png\" alt=\"Payment Flow\" width=\"250\"/\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"screenshot3.png\" alt=\"Transaction Complete\" width=\"250\"/\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## 🎯 Use Cases\n\n- **E-commerce apps** — Accept UPI payments seamlessly\n- **Bill payment apps** — Quick utility bill settlements\n- **Peer-to-peer payment apps** — Send money to friends\n- **Subscription services** — Recurring UPI payments\n- **Donation platforms** — Accept contributions via UPI\n\n## 📦 Installation\n\n### NPM\n\n```bash\nnpm install react-native-upi-launcher\n```\n\n### Yarn\n\n```bash\nyarn add react-native-upi-launcher\n```\n\n### For React Native \u003c 0.60\n\n```bash\nreact-native link react-native-upi-launcher\n```\n\n## 🚀 Quick Start\n\n### 1. Fetch Installed UPI Apps\n\n```javascript\nimport { fetchUpiApps } from \"react-native-upi-launcher\";\n\nconst getAvailableUpiApps = async () =\u003e {\n  try {\n    const apps = await fetchUpiApps();\n    console.log(\"Available UPI apps:\", apps);\n    /*\n    Output example:\n    [\n      { packageName: \"com.phonepe.app\", appName: \"PhonePe\" },\n      { packageName: \"com.google.android.apps.nbu.paisa.user\", appName: \"Google Pay\" },\n      { packageName: \"net.one97.paytm\", appName: \"Paytm\" }\n    ]\n    */\n  } catch (error) {\n    console.error(\"Error fetching UPI apps:\", error);\n  }\n};\n```\n\n### 2. Launch UPI Payment Intent\n\n```javascript\nimport { openUpiIntent } from \"react-native-upi-launcher\";\n\nconst makePayment = async () =\u003e {\n  const upiUrl =\n    \"upi://pay?pa=merchant@upi\u0026pn=Merchant%20Name\u0026am=100\u0026cu=INR\u0026tn=Order%20Payment\";\n  const preferredApp = \"com.phonepe.app\"; // Optional: specific UPI app package\n\n  try {\n    const result = await openUpiIntent(upiUrl, preferredApp);\n    console.log(\"Payment initiated:\", result);\n  } catch (error) {\n    console.error(\"Payment failed:\", error);\n  }\n};\n```\n\n### 3. Complete Example with Error Handling\n\n```javascript\nimport React, { useState, useEffect } from \"react\";\nimport { View, Button, FlatList, Text, Alert } from \"react-native\";\nimport { fetchUpiApps, openUpiIntent } from \"react-native-upi-launcher\";\n\nconst PaymentScreen = () =\u003e {\n  const [upiApps, setUpiApps] = useState([]);\n\n  useEffect(() =\u003e {\n    loadUpiApps();\n  }, []);\n\n  const loadUpiApps = async () =\u003e {\n    try {\n      const apps = await fetchUpiApps();\n      setUpiApps(apps);\n    } catch (error) {\n      Alert.alert(\"Error\", \"Failed to load UPI apps\");\n    }\n  };\n\n  const initiatePayment = async (packageName) =\u003e {\n    const upiUrl =\n      \"upi://pay?pa=test@upi\u0026pn=Test%20User\u0026am=1\u0026cu=INR\u0026tn=Test%20Payment\";\n\n    try {\n      await openUpiIntent(upiUrl, packageName);\n      Alert.alert(\"Success\", \"Payment initiated successfully\");\n    } catch (error) {\n      Alert.alert(\"Error\", \"Payment failed: \" + error.message);\n    }\n  };\n\n  return (\n    \u003cView\u003e\n      \u003cFlatList\n        data={upiApps}\n        keyExtractor={(item) =\u003e item.packageName}\n        renderItem={({ item }) =\u003e (\n          \u003cButton\n            title={`Pay with ${item.appName}`}\n            onPress={() =\u003e initiatePayment(item.packageName)}\n          /\u003e\n        )}\n      /\u003e\n    \u003c/View\u003e\n  );\n};\n\nexport default PaymentScreen;\n```\n\n## 📋 API Reference\n\n### `fetchUpiApps(): Promise\u003cUpiApp[]\u003e`\n\nFetches all installed UPI applications on the device.\n\n**Returns:** Array of UPI app objects\n\n```typescript\ninterface UpiApp {\n  packageName: string; // e.g., \"com.phonepe.app\"\n  appName: string; // e.g., \"PhonePe\"\n}\n```\n\n### `openUpiIntent(upiUrl: string, packageName?: string): Promise\u003cvoid\u003e`\n\nLaunches UPI payment intent.\n\n**Parameters:**\n\n- `upiUrl` (required): UPI payment URL string\n- `packageName` (optional): Specific UPI app package name. If omitted or app not found, shows chooser.\n\n**UPI URL Format:**\n\n```\nupi://pay?pa=\u003cUPI_ID\u003e\u0026pn=\u003cNAME\u003e\u0026am=\u003cAMOUNT\u003e\u0026cu=\u003cCURRENCY\u003e\u0026tn=\u003cNOTE\u003e\n```\n\n**Parameters:**\n\n- `pa` — Payee UPI address (required)\n- `pn` — Payee name (required)\n- `am` — Amount (optional)\n- `cu` — Currency (default: INR)\n- `tn` — Transaction note (optional)\n\n## 📱 Popular UPI App Package Names\n\n| App            | Package Name                             |\n| -------------- | ---------------------------------------- |\n| **PhonePe**    | `com.phonepe.app`                        |\n| **Google Pay** | `com.google.android.apps.nbu.paisa.user` |\n| **Paytm**      | `net.one97.paytm`                        |\n| **BHIM**       | `in.org.npci.upiapp`                     |\n| **Amazon Pay** | `in.amazon.mShop.android.shopping`       |\n| **WhatsApp**   | `com.whatsapp`                           |\n| **Mobikwik**   | `com.mobikwik_new`                       |\n| **Freecharge** | `com.freecharge.android`                 |\n\n## ⚙️ Configuration\n\n### Adding Support for Additional UPI Apps\n\nIf you need to support UPI apps beyond the default list, add their package names to your `AndroidManifest.xml`:\n\n```xml\n\u003cmanifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.yourapp\"\u003e\n\n    \u003cqueries\u003e\n        \u003c!-- Default UPI apps (already included in library) --\u003e\n        \u003cpackage android:name=\"com.phonepe.app\" /\u003e\n        \u003cpackage android:name=\"com.google.android.apps.nbu.paisa.user\" /\u003e\n        \u003cpackage android:name=\"net.one97.paytm\" /\u003e\n        \u003cpackage android:name=\"in.org.npci.upiapp\" /\u003e\n\n        \u003c!-- Add your custom UPI apps here --\u003e\n        \u003cpackage android:name=\"com.mybank.upi\" /\u003e\n        \u003cpackage android:name=\"com.customwallet.app\" /\u003e\n    \u003c/queries\u003e\n\n    \u003capplication\u003e\n        \u003c!-- Your app configuration --\u003e\n    \u003c/application\u003e\n\u003c/manifest\u003e\n```\n\n**Note:** For Android 11+ (API 30+), you must declare package visibility queries in your manifest for apps you want to detect.\n\n## 🔧 Troubleshooting\n\n### Common Issues\n\n**1. No UPI apps detected**\n\n- Ensure UPI apps are installed on the device\n- Check `AndroidManifest.xml` has proper `\u003cqueries\u003e` declarations\n- Verify targetSdkVersion is 30 or higher\n\n**2. App chooser not showing**\n\n- Verify the UPI URL format is correct\n- Check that at least one UPI app is installed\n- Ensure proper permissions in AndroidManifest\n\n**3. Payment not initiating**\n\n- Validate UPI URL parameters\n- Check network connectivity\n- Verify UPI app is up to date\n\n## 🍎 iOS Support\n\nOn 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.\n\n```javascript\nimport { Linking, Platform } from \"react-native\";\nimport { openUpiIntent } from \"react-native-upi-launcher\";\n\nconst handlePayment = async (upiUrl) =\u003e {\n  if (Platform.OS === \"ios\") {\n    // iOS fallback\n    await Linking.openURL(upiUrl);\n  } else {\n    // Android - full functionality\n    await openUpiIntent(upiUrl);\n  }\n};\n```\n\n## 🔐 Security Best Practices\n\n- ✅ Always validate UPI URLs on your backend\n- ✅ Never hardcode sensitive payment information\n- ✅ Implement proper error handling\n- ✅ Verify transaction status via server callbacks\n- ✅ Use HTTPS for all API communications\n- ✅ Sanitize user inputs before creating UPI URLs\n\n## 🧪 Testing\n\nTest with these sample UPI URLs:\n\n```javascript\n// Test payment (will fail gracefully)\nconst testUrl =\n  \"upi://pay?pa=test@paytm\u0026pn=Test%20Merchant\u0026am=1\u0026cu=INR\u0026tn=Test\";\n\n// Use your own UPI ID for testing\nconst realUrl = \"upi://pay?pa=yourname@paytm\u0026pn=Your%20Name\u0026am=10\u0026cu=INR\";\n```\n\n## 📊 Performance\n\n- **Bundle size:** \u003c 15KB\n- **No external dependencies**\n- **Native Android implementation** for optimal performance\n- **Async/await support** for modern JavaScript\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n### Development Workflow\n\n1. Fork the repository\n2. Create your feature branch: `git checkout -b feature/amazing-feature`\n3. Commit your changes: `git commit -m 'Add amazing feature'`\n4. Push to the branch: `git push origin feature/amazing-feature`\n5. Open a Pull Request\n\nSee detailed [development workflow](CONTRIBUTING.md#development-workflow) guide.\n\n## 📝 Code of Conduct\n\nPlease read our [Code of Conduct](CODE_OF_CONDUCT.md) before contributing.\n\n## 📄 License\n\nMIT © Vivek Negi\n\nSee [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- Built with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)\n- Inspired by the Indian digital payment ecosystem\n\n## 🔗 Links\n\n- **NPM Package:** [npmjs.com/package/react-native-upi-launcher](https://www.npmjs.com/package/react-native-upi-launcher)\n- **GitHub:** [github.com/vivnegi21/react-native-upi-launcher](https://github.com/vivnegi21/react-native-upi-launcher)\n- **Issues:** [github.com/vivnegi21/react-native-upi-launcher/issues](https://github.com/vivnegi21/react-native-upi-launcher/issues)\n- **Changelog:** [CHANGELOG.md](CHANGELOG.md)\n\n## 📈 Stats\n\n![GitHub stars](https://img.shields.io/github/stars/vivnegi21/react-native-upi-launcher?style=social)\n![GitHub forks](https://img.shields.io/github/forks/vivnegi21/react-native-upi-launcher?style=social)\n\n---\n\n**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\n\n**Made with ❤️ for the React Native community**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvivnegi21%2Freact-native-upi-launcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvivnegi21%2Freact-native-upi-launcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvivnegi21%2Freact-native-upi-launcher/lists"}