SDK Overview
The Pybara SDK is a JavaScript library for integrating crypto payments into web applications.
Features
Section titled “Features”- Wallet Connections — Connect to Oisy, Plug, and NFID wallets
- Token Transfers — Execute ICRC-1 transfers
- Payment Calculator — Convert fiat to crypto amounts
- Balance Checking — Check wallet balances
- TypeScript Support — Full type definitions included
Installation
Section titled “Installation”npm install @yogabuild/pybara-sdkQuick Start
Section titled “Quick Start”import { PybaraSDK } from '@yogabuild/pybara-sdk';
const sdk = new PybaraSDK({ merchantPrincipal: 'your-principal-id', environment: 'production', // or 'testnet'});
// Connect walletawait sdk.connectWallet('oisy');
// Calculate payment amountconst amount = await sdk.calculatePayment({ fiatAmount: 99.99, fiatCurrency: 'USD', token: 'ICP',});
// Execute paymentconst result = await sdk.executePayment({ amount, token: 'ICP', orderId: 'order-123',});
console.log('Payment successful:', result.blockIndex);Platform Support
Section titled “Platform Support”The SDK is platform-agnostic and works with:
- React
- Vue
- Angular
- Svelte
- Vanilla JavaScript
- Any JavaScript framework
Browser Support
Section titled “Browser Support”- Chrome/Edge 90+
- Firefox 88+
- Safari 14+