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

@paysafe/react-native-paysafe-apple-pay

v1.0.1

Published

A React Native package for integrating Apple Pay using the Paysafe SDK.

Readme

@paysafe/react-native-paysafe-apple-pay

React Native bridge for Apple Pay using the same PaysafePaymentsSDK (Swift) as @paysafe/paysafe-payments-sdk-common.

Prerequisites

  1. setup from @paysafe/paysafe-payments-sdk-common (API key + TEST / PROD environment) must complete successfully before Apple Pay calls.
  2. Apple Pay capability and valid Merchant ID in Xcode.
  3. A card Paysafe account with Apple Pay enabled (the native SDK validates this when initializing context).

Flow

  1. initializeApplePayContext — Validates options in JS, then native PSApplePayContext / Paysafe config for the account (currency, account id, merchant id, country).
  2. tokenize — Validates options in JS (throws if invalid), then native flow presents the Apple Pay sheet and returns PaysafeApplePayPaymentResult (isSuccess + token, or error from native; some thrown errors are mapped to that shape in JS).
  3. resetApplePayContext — Clears the native context when you are done (for example on unmount or sign-out).

Installation

npm install @paysafe/react-native-paysafe-apple-pay
cd ios && pod install

Pod: PaysafePaymentsSDK + PassKit.

Usage

import { setup } from '@paysafe/paysafe-payments-sdk-common';
import {
  initializeApplePayContext,
  isApplePayAvailable,
  tokenize,
} from '@paysafe/react-native-paysafe-apple-pay';

await setup(apiKey, 'TEST');

const availability = await isApplePayAvailable({
  supportedNetworks: ['visa', 'masterCard'],
});

await initializeApplePayContext({
  currencyCode: 'USD',
  accountId: 'YOUR_ACCOUNT_ID',
  merchantIdentifier: 'merchant.com.example',
  countryCode: 'US',
});

const result = await tokenize({
  amount: 1099, // minor units (e.g. cents)
  currencyCode: 'USD',
  transactionType: 'PAYMENT',
  merchantRefNum: 'unique-ref',
  accountId: 'YOUR_ACCOUNT_ID',
  profile: {
    firstName: 'Jane',
    lastName: 'Doe',
    email: '[email protected]',
  },
  psApplePay: { label: 'Order total', requestBillingAddress: false },
  requestBillingAddress: false,
  // Optional: simulator, billingDetails, shippingDetails, merchantDescriptor — see PaysafeApplePayTokenizeOptions in src/types.ts
});

if (result.isSuccess) {
  console.log(result.token);
}

API

| Function | Description | |----------|-------------| | initializeApplePayContext(options) | Validates in JS, then native init (throws on non‑iOS or invalid options). | | resetApplePayContext() | Clears the stored context (no‑op on non‑iOS). | | tokenize(options) | Validates in JS, then sheet + tokenization → PaysafeApplePayPaymentResult (throws on non‑iOS; invalid options throw). | | isApplePayAvailable(request?) | PassKit availability; optional supportedNetworks. | | validateTokenizeOptions / validateInitializeContextOptions | JS-side validation helpers (same rules enforced before native calls). |

Exported TypeScript types (for example PaysafeApplePayTokenizeOptions, ApplePayNetwork) are re-exported from the package entry.

Android / non‑iOS

Apple Pay is iOS-only. initializeApplePayContext and tokenize throw on non‑iOS. resetApplePayContext is a no‑op. isApplePayAvailable resolves with all availability flags set to false.