Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@transak/react-native-sdk

Package Overview
Dependencies
Maintainers
5
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@transak/react-native-sdk

A React Native SDK for decentralised applications to onboard their global user base with fiat currency

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

Transak React Native SDK

A React Native SDK for decentralised applications to onboard their global user base with fiat currency.

Installation

npm i @transak/react-native-sdk

Install these required peer dependencies to facilitate auto-linking.

npm i react-native-webview
npm i react-native-inappbrowser-reborn
npm i @react-native-community/netinfo

Example usage

import {
  TransakWebView, Environments, Events, TransakConfig, EventTypes, Order,
} from '@transak/react-native-sdk';

function TransakWebViewIntegration() {
  const transakConfig: TransakConfig = {
    apiKey: '<your-api-key>', // Required
    environment: Environments.STAGING/Environments.PRODUCTION, // Required
    partnerOrderId: '<unique-order-id-generated-by-your-system>', // Required to receive order events
    // .....
    // For the full list of query params refer Props section below
  };
  const onTransakEventHandler = (event: EventTypes, data: Order) => {
    switch(event) {
      case Events.ORDER_CREATED:
        console.log(event, data);
        break;

      case Events.ORDER_PROCESSING:
        console.log(event, data);
        break;

      case Events.ORDER_COMPLETED:
        console.log(event, data);
        break;

      default:
        console.log(event, data);
    }
  };

  return (
    <TransakWebView
      transakConfig={transakConfig}
      onTransakEvent={onTransakEventHandler}
      // .....
      // For the full list of react-native-webview props refer Props section below
    />
  );
}

Props

PropDescription
transakConfigRefer here for the full list of customisation options
onTransakEventCallback function to listen to order related events


This component accepts most of the react-native-webview props, except the following: sharedCookiesEnabled, injectedJavaScript, injectedJavaScriptBeforeContentLoaded

[!CAUTION] The partnerOrderId must be passed in the transakConfig to receive order events.

License

ISC Licensed. Copyright (c) 2024 Transak Inc.

Keywords

FAQs

Package last updated on 13 Jun 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc