Transak SDK
A library for decentralised applications to onboard their global user base with fiat currency.
Installation
$ yarn add @transak/transak-sdk
$ npm install @transak/transak-sdk
Example usage
import { TransakConfig, Transak } from '@transak/transak-sdk';
const transakConfig: TransakConfig = {
apiKey: '<your-api-key>',
environment: Transak.ENVIRONMENTS.STAGING/Transak.ENVIRONMENTS.PRODUCTION,
};
let transak = new Transak(transakConfig);
transak.init();
Transak.on('*', (data) => {
console.log(data);
});
Transak.on(Transak.EVENTS.TRANSAK_WIDGET_CLOSE, () => {
console.log('Transak SDK closed!');
});
Transak.on(Transak.EVENTS.TRANSAK_ORDER_CREATED, (orderData) => {
console.log(orderData);
});
Transak.on(Transak.EVENTS.TRANSAK_ORDER_SUCCESSFUL, (orderData) => {
console.log(orderData);
transak.close();
});
Refer here for the full list of customisation options
For in-depth instructions on integrating Transak, view our complete documentation.
Migration Guide for v2
This guide will help you to upgrade to v2 successfully!