Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@transak/react-native-sdk

Package Overview
Dependencies
Maintainers
5
Versions
18
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

latest
Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
206
-47.45%
Maintainers
5
Weekly downloads
 
Created
Source

Transak React Native SDK

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

Migrating from v2.x

  • 🔗 Widget URL Mandatory: This SDK now only supports API-based Transak Widget URL. Please refer the detailed migration guide here.

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, Events, TransakConfig, OnTransakEvent, Order } from '@transak/react-native-sdk';

function TransakWebViewIntegration() {
  const transakConfig: TransakConfig = {
    widgetUrl: 'api-generated-widgetUrl', // Required
    referrer: 'https://your-app.com', // Required - Must be a valid URL
  };

  const onTransakEventHandler: OnTransakEvent = (event, data) => {
    switch (event) {
      case Events.TRANSAK_WIDGET_INITIALISED:
        console.log('Widget initialized:', event, data);
        break;

      case Events.TRANSAK_ORDER_CREATED:
        console.log('Order created:', event, data);
        break;

      case Events.TRANSAK_ORDER_SUCCESSFUL:
        console.log('Order successful:', event, data);
        break;

      case Events.TRANSAK_ORDER_FAILED:
        console.log('Order failed:', event, data);
        break;

      case Events.TRANSAK_WIDGET_CLOSE:
        console.log('Widget closed:', event, data);
        break;

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

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

Props

PropDescription
transakConfigRefer transakConfig section below
onTransakEventCallback function to listen to widget events such as initialization, order creation, success, failure, etc.


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

transakConfig

PropertyTypeRequiredDescription
widgetUrlstringYesAPI generated widgetUrl
referrerstringYesValid URL of your app/website (e.g., https://your-app.com)

Available Events

The SDK emits the following widget events:

  • TRANSAK_WIDGET_INITIALISED - When the widget is loaded and ready
  • TRANSAK_ORDER_CREATED - When a new order is created
  • TRANSAK_ORDER_SUCCESSFUL - When an order is completed successfully
  • TRANSAK_ORDER_CANCELLED - When an order is canceled
  • TRANSAK_ORDER_FAILED - When an order fails
  • TRANSAK_WALLET_REDIRECTION - When user is redirected to wallet
  • TRANSAK_WIDGET_CLOSE - When the widget is closed

License

ISC Licensed. Copyright (c) Transak Inc.

Keywords

crypto

FAQs

Package last updated on 17 Sep 2025

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