Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

react-native-purchase-kit

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-purchase-kit

StoreKit 2 and Billing API for React Native

latest
Source
npmnpm
Version
0.4.0
Version published
Maintainers
1
Created
Source

npm downloads discord users online

StoreKit 2 for React Native


It's built on top of the latest StoreKit 2 and Android Billing Library 3.0.0+ (coming soon). At the moment, it only supports subscriptions and there is a single API for both platforms. Check out below.

Installation

Requires iOS 15+ and Android minSdkVersion = 24.

yarn add react-native-purchase-kit

Basic Usage

Configure app to use StoreKit 2 and Android Billing Library 3.0.0+.

import PurchaseKit from 'react-native-purchase-kit';

const kit = new PurchaseKit();

// Get products
const products = await kit.getProducts(['monthly_subscription']);

// Buy a product
const transaction = await kit.purchase({
  productID: 'monthly_subscription',
  uuid: 'uuid',
});

// Get recent transactions
kit.getRecentTransactions();

// Get receipt
const receipt = await kit.readReceipt();

// Listen to events
kit.addListener('transactions', (event) => {
  if (event.kind === 'transactions') {
    console.log(event.transaction);
  }
});

License

MIT

Keywords

react-native

FAQs

Package last updated on 28 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts