Official Busha Ramp Web SDK for integrating cryptocurrency on-ramp functionality into web applications.
- Easy Integration: Simple API for adding crypto on-ramp to your web app
- TypeScript Support: Full TypeScript definitions included
- Framework Agnostic: Works with React, Vue, Angular, or vanilla JavaScript
- Customizable: Flexible configuration options
- Secure: Built with security best practices
# Using npm
npm install @busha/ramp-web-sdk
# Using yarn
yarn add @busha/ramp-web-sdk<script src="https://cdn.jsdelivr.net/npm/@busha/ramp-web-sdk/dist/index.umd.js"></script>The SDK is available in multiple formats:
- ES Module (
dist/index.es.js): For modern bundlers and ES modules - UMD (
dist/index.umd.js): For CDN usage and older environments
The package.json exports are configured to automatically use the appropriate format based on your build environment.
import { BushaRampWidget } from '@busha/ramp-web-sdk';
const ramp = new BushaRampWidget({
publicKey: 'your_public_key_here',
side: 'buy', // 'buy' or 'sell'
onSuccess: (transaction) => {
console.log('Transaction successful:', transaction);
},
onClose: () => {
console.log('Widget closed');
},
});
// Show the widget
ramp.show();import React from 'react';
import { BushaRampWidget } from '@busha/ramp-web-sdk';
function App() {
const handleShowWidget = () => {
const ramp = new BushaRampWidget({
publicKey: 'your_public_key_here',
side: 'buy',
onSuccess: (transaction) => {
console.log('Success:', transaction);
},
onClose: () => {
console.log('Widget closed');
},
});
ramp.show();
};
return (
<div>
<h1>My Crypto App</h1>
<button onClick={handleShowWidget}>
Buy Crypto
</button>
</div>
);
}<!DOCTYPE html>
<html>
<head>
<title>Crypto App</title>
</head>
<body>
<button id="buyCrypto">Buy Crypto</button>
<script src="https://cdn.jsdelivr.net/npm/@busha/ramp-web-sdk/dist/index.umd.js"></script>
<script>
const { BushaRampWidget } = window.BushaRampWeb;
const ramp = new BushaRampWidget({
publicKey: 'your_public_key_here',
side: 'buy',
onSuccess: (transaction) => {
console.log('Success:', transaction);
},
onClose: () => {
console.log('Widget closed');
},
});
document.getElementById('buyCrypto').addEventListener('click', () => {
ramp.show();
});
</script>
</body>
</html>| Option | Type | Required | Description |
|---|---|---|---|
publicKey |
string |
β | Your Busha public key |
side |
'buy' | 'sell' |
β | Transaction type |
onSuccess |
function |
β | Callback when transaction succeeds |
onClose |
function |
β | Callback when widget closes |
onError |
function |
β | Callback when an error occurs |
amount |
number |
β | Pre-filled amount |
currency |
string |
β | Default currency (e.g., 'USD') |
cryptoAsset |
string |
β | Default crypto currency (e.g., 'BTC') |
sandboxMode |
boolean |
β | Sandbox mode, defaults to false |
| Method | Description |
|---|---|
show() |
Display the widget |
close() |
Close the widget and trigger onClose callback |
- Node.js 18+
- Yarn or npm
# Clone the repository
git clone https://github.com/bushaHQ/ramp-web-sdk.git
cd busha-ramp-web-sdk
# Install dependencies
yarn install
# Start development server
yarn dev
# Run tests
yarn test
# Build for production
yarn build# Run tests
yarn test
# Run tests in watch mode
yarn test:watch
# Run tests with UI
yarn test:ui# Patch release (bug fixes)
./scripts/release.sh patch
# Minor release (new features)
./scripts/release.sh minor
# Major release (breaking changes)
./scripts/release.sh major# Update version in package.json
# Create and push tag
git tag v1.0.0
git push origin v1.0.0The GitHub Actions workflow will automatically:
- Run tests
- Build the package
- Publish to npm
MIT License - see LICENSE file for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Documentation: https://docs.busha.co
- Issues: GitHub Issues
- Email: support@busha.co