Transak SDK
A JavaScript 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
Refer here for the full list of customisation options
import transakSDK from '@transak/transak-sdk';
let transak = new transakSDK({
apiKey: '<your-api-key>',
environment: '<environment: STAGING/PRODUCTION>',
});
transak.init();
transak.on(transak.ALL_EVENTS, (data) => {
console.log(data);
});
transak.on(transak.EVENTS.TRANSAK_WIDGET_CLOSE, (orderData) => {
transak.close();
});
transak.on(transak.EVENTS.TRANSAK_ORDER_SUCCESSFUL, (orderData) => {
console.log(orderData);
transak.close();
});
For in-depth instructions on integrating Transak, view our complete documentation.