JSPM

  • Created
  • Published
  • Downloads 4290
  • Score
    100M100P100Q127133F
  • License MIT

Primer SDK for RN

Package Exports

  • @primer-io/react-native

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@primer-io/react-native) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Primer React Native SDK

Official React Native SDK plugin for Primer

💾 Installation

npm install @primer-io/react-native

🔧 Usage

import { Primer } from '@primer-io/react-native';

// fetch Primer client token from backend.
const token: string = await fetchClientToken();

// configure settings, theme, and listeners.
const onTokenizeSuccess: OnTokenizeSuccessCallback = (t, handler) => {
  setPaymentInstrument(t);
  handler.resumeWithSuccess(); // call this to resume the checkout flow.
};

const config = { onTokenizeSuccess };

// show Universal Checkout with client token and config.
Primer.showUniversalCheckout(token, config);

📚 License

Distributed under the MIT License. See LICENSE for more information.