Plug & Pay SDK Component

Complete API reference for the WidgetSDK component

The WidgetSDK component is the main entry point for embedding the Oobit Widget in your React Native application.

Import

import { WidgetSDK } from "@oobit/react-native-sdk";

Basic Usage

<WidgetSDK
  accessToken="your-jwt-token"
  userWalletAddress="0x1234..."
  onTransactionRequested={(transaction) => {
    // Navigate user to transaction confirmation screen
    navigation.navigate('ConfirmTransaction', { transaction });
  }}
/>

Props

PropTypeRequiredDescription
accessTokenstringYesJWT token from your backend (Create Token API)
userWalletAddressstringYesUser's crypto wallet address to deposit from
onTransactionRequested(transaction: TransactionRequest) => voidYesCalled when user initiates a transaction. See Handling Transactions
onClose() => voidNoCalled when user requests to close the widget

Security: Never generate tokens client-side. Always obtain them from your backend server.

Example

<WidgetSDK
  accessToken={tokenFromBackend}
  userWalletAddress="0x742d35Cc6634C0532925a3b844Bc9e7595f..."
  onTransactionRequested={(transaction) => {
    const { symbol, amount } = transaction.tokenMetadata;
    navigation.navigate('ConfirmTransaction', { transaction });
  }}
  onClose={() => navigation.goBack()}
/>

See Also