
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@transak/react-native-sdk
Advanced tools
A React Native SDK for decentralised applications to onboard their global user base with fiat currency
A React Native SDK for decentralized applications to onboard their global user base with fiat currency.
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
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
/>
);
}
Prop | Description |
---|---|
transakConfig | Refer transakConfig section below |
onTransakEvent | Callback 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
Property | Type | Required | Description |
---|---|---|---|
widgetUrl | string | Yes | API generated widgetUrl |
referrer | string | Yes | Valid URL of your app/website (e.g., https://your-app.com) |
The SDK emits the following widget events:
TRANSAK_WIDGET_INITIALISED
- When the widget is loaded and readyTRANSAK_ORDER_CREATED
- When a new order is createdTRANSAK_ORDER_SUCCESSFUL
- When an order is completed successfullyTRANSAK_ORDER_CANCELLED
- When an order is canceledTRANSAK_ORDER_FAILED
- When an order failsTRANSAK_WALLET_REDIRECTION
- When user is redirected to walletTRANSAK_WIDGET_CLOSE
- When the widget is closedISC Licensed. Copyright (c) Transak Inc.
FAQs
A React Native SDK for decentralised applications to onboard their global user base with fiat currency
The npm package @transak/react-native-sdk receives a total of 162 weekly downloads. As such, @transak/react-native-sdk popularity was classified as not popular.
We found that @transak/react-native-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.