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
repoandread:packagepermissions
Next, create a .npmrc file and be sure to use the PAT
where it says YOUR_GITHUB_PACKAGES_TOKEN in the example below.
@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
npm install @tyro/tyro-pay-api-react-nativeyarn add @tyro/tyro-pay-api-react-nativeiOS
Requirements
- Xcode
14.0or later - iOS
14or later
Install Native Dependencies
// navigate to your ios directory to install dependencies
pod installAndroid
Requirements
Make sure your app's build file uses the following values:
- A
minSdkVersionof23or higher - A
compileSdkVersionof31or higher
Install Native Dependencies
npm install react-native-svg react-native-webview