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
| Prop | Type | Required | Description |
|---|---|---|---|
accessToken | string | Yes | JWT token from your backend (Create Token API) |
userWalletAddress | string | Yes | User's crypto wallet address to deposit from |
onTransactionRequested | (transaction: TransactionRequest) => void | Yes | Called when user initiates a transaction. See Handling Transactions |
onClose | () => void | No | Called 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
- TypeScript Types - Complete type definitions
- Handling Transactions - Transaction handling guide
Updated 1 day ago
