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

@monei-js/monei-pay-react-native-sdk

v0.2.1

Published

React Native SDK for accepting NFC payments via MONEI Pay

Readme

MONEI Pay React Native SDK

Accept NFC tap-to-pay payments in your React Native app via MONEI Pay.

Built as an Expo module — works with both Expo and bare React Native projects.

Requirements

  • React Native 0.73+
  • Expo SDK 50+
  • iOS 15.0+ / Android 8.0+ (API 26)
  • POS auth token from your backend (POST /v1/pos/auth-token)

Installation

npx expo install @monei-pay/react-native

Or with npm/pnpm:

npm install @monei-pay/react-native
# or
pnpm add @monei-pay/react-native

iOS Setup

Add to your app.json or app.config.js:

{
  "expo": {
    "ios": {
      "infoPlist": {
        "LSApplicationQueriesSchemes": ["monei-pay"]
      }
    },
    "scheme": "your-app-scheme"
  }
}

Android Setup

No additional setup needed — the SDK's AndroidManifest includes the required <queries> entries.

Usage

import { useEffect } from 'react';
import { Linking, Platform } from 'react-native';
import * as MoneiPay from '@monei-pay/react-native';

function PaymentScreen() {
  // Wire URL callback handler (iOS only)
  useEffect(() => {
    if (Platform.OS === 'ios') {
      const sub = Linking.addEventListener('url', ({ url }) => {
        MoneiPay.handleCallback(url);
      });
      return () => sub.remove();
    }
  }, []);

  const handlePayment = async () => {
    try {
      const result = await MoneiPay.acceptPayment({
        token: 'eyJ...',              // Raw JWT from your backend
        amount: 1500,                 // Amount in cents (1500 = 15.00 EUR)
        description: 'Order #123',    // Optional
        customerName: 'John Doe',     // Optional
        customerEmail: '[email protected]', // Optional
        callbackScheme: 'your-app',   // iOS only — your registered URL scheme
        mode: 'direct',               // Android only — 'direct' or 'via-monei-pay'
      });

      console.log('Payment approved:', result.transactionId);
      console.log('Card:', result.cardBrand, result.maskedCardNumber);
    } catch (error) {
      console.error('Payment failed:', error.message);
    }
  };

  return <Button title="Pay" onPress={handlePayment} />;
}

API Reference

acceptPayment(params)

Accept an NFC payment. Returns a Promise.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | token | string | Yes | Raw JWT auth token (no "Bearer " prefix) | | amount | number | Yes | Amount in cents | | description | string | No | Payment description | | customerName | string | No | Customer name | | customerEmail | string | No | Customer email | | customerPhone | string | No | Customer phone | | callbackScheme | string | iOS | Your app's registered URL scheme | | mode | string | No | Android: 'direct' (default) or 'via-monei-pay' |

Returns PaymentResult. Throws on failure.

handleCallback(url)

Handle incoming callback URL from MONEI Pay (iOS only). Wire into your Linking handler.

cancelPendingPayment()

Cancel any pending payment.

PaymentResult

| Property | Type | Description | |----------|------|-------------| | transactionId | string | Unique transaction ID | | success | boolean | Whether payment was approved | | amount | number | Amount in cents | | cardBrand | string | Card brand (visa, mastercard, etc.) | | maskedCardNumber | string | Masked card number (****1234) |

Error Codes

| Code | Description | |------|-------------| | NOT_INSTALLED | MONEI Pay or CloudCommerce not on device | | PAYMENT_IN_PROGRESS | Another payment is active | | CANCELLED | User cancelled | | PAYMENT_FAILED | Payment declined/failed | | INVALID_PARAMS | Invalid input parameters | | INVALID_TOKEN | Auth token expired or invalid | | PAYMENT_TIMEOUT | Callback not received in time (iOS) |

Example App

The example/ directory contains a merchant demo app that demonstrates the full payment flow:

  1. Enter your MONEI API key
  2. Fetch a POS auth token
  3. Enter an amount and accept an NFC payment
  4. View the payment result

To run:

cd example
npm install
npx expo run:ios    # or npx expo run:android

Requires a physical device — NFC is not available in simulators/emulators.

Token Generation

Your backend generates POS auth tokens via the MONEI API:

curl -X POST https://api.monei.com/v1/pos/auth-token \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json"

See the MONEI API docs for details.

License

MIT