Skip to main content
These instructions are specifically for the React Native SDK. Building with another framework? See Supported Frameworks.

Architecture Overview

Architecture Overview

Package Installation

npm install @taprails/tap-to-pay

Peer Dependencies

The SDK requires these peer dependencies. Install them all:
npm install \
  buffer \
  react-native-get-random-values@^1.11.0 \
  react-native-keychain@^8.2.0 \
  react-native-nfc-manager \
  react-native-device-info \
  react-native-svg \
  react-native-reanimated \
  react-native-safe-area-context
Version constraints matter:
  • Use react-native-keychain@^8.2.0 — v10+ requires AndroidX DataStore, which conflicts with React Native 0.72.
  • Use react-native-get-random-values@^1.11.0 — v2+ requires React Native 0.81+.

What each dependency does

PackagePurpose
bufferNDEF payload Binary ↔ String decoding
react-native-get-random-valuesSecure random number generation for TweetNaCl
react-native-keychainSecure device Keychain storage for private keys
react-native-nfc-managerNFC tag reading on both platforms
react-native-device-infoDevice UUID and metadata for device registration
react-native-svgIcons and animated NFC graphics in the built-in UI
react-native-reanimated60fps animations in payment flow screens
react-native-safe-area-contextProper insets for full-screen modal UI

Polyfills

Add these at the very top of your app entry point, before any other imports:
index.js
import 'react-native-get-random-values';
import { Buffer } from 'buffer';
global.Buffer = Buffer;
These must be the very first lines in your entry file. React Native’s module bundler evaluates them in order — if another module that needs them loads first, you’ll get a runtime crash.

Framework Compatibility

SetupSupported
Bare React Native CLI✅ Full support
Expo (Development Build)✅ Supported
Expo Go❌ Native modules not supported
If using Expo, you must use a Development Build (via expo-dev-client). Expo Go does not support native modules like react-native-keychain or react-native-nfc-manager.

Platform-Specific Setup

React Native Setup

Install the SDK and process your first NFC payment in 5 minutes.

Android Setup

Gradle dependencies, AndroidManifest.xml permissions, and HCE service configuration.

iOS Setup

CocoaPods and Info.plist NFC usage description.