Tyro React Native SDK

The Tyro React Native SDK is a specialised JavaScript library for React Native provided by Tyro. It provides a simple interface to integrate with the Pay API from your React Native application. You can embed our pay sheet provided by our SDK in your apps checkout flow and submit payments via our Pay API using supported cards or wallet payments via Apple and Google Pay.

Recommended Usage

Apple and Google stores have requirements over in-app purchases such as purchasing in-app subscriptions or purchases to unlock additional app features. If your app offers these types of purchases then it must use their respective APIs, otherwise you can use Tyro's React Native SDK for the Pay API. See the terms for Apple and Google respectively for more information.

Installing Tyro React Native SDK

Install Tyro React Native Dependency

Github Personal Access Token (PAT) is required to download the SDK.

Steps to setup the PAT:

  • Navigate to GitHub page, Profile -> Settings -> Developer Settings
  • On the left panel, select Personal Access Token -> Token(classic)
  • Generate a new token with repo and read:package permissions

Next, create a .npmrc file and be sure to use the PAT where it says YOUR_GITHUB_PACKAGES_TOKEN in the example below.

Copy
Copied
@tyro:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${YOUR_GITHUB_PACKAGES_TOKEN}

Then you can install the package using npm or yarn

npmyarn
Copy
Copied
npm install @tyro/tyro-pay-api-react-native
Copy
Copied
yarn add @tyro/tyro-pay-api-react-native

iOS

Requirements

  • Xcode 14.0 or later
  • iOS 14 or later

Install Native Dependencies

Copy
Copied
// navigate to your ios directory to install dependencies
pod install

Android

Requirements

Make sure your app's build file uses the following values:

  • A minSdkVersion of 23 or higher
  • A compileSdkVersion of 31 or higher

Install Native Dependencies

Copy
Copied
npm install react-native-svg react-native-webview
Copyright © Tyro Payments 2019-2024. All right reserved.