GithubHelp home page GithubHelp logo

transak-sdk's Introduction

Transak SDK

A JavaScript library for decentralised applications to onboard their global user base with fiat currency.

Installation

To use the Transak widget with your javascript application, you will need to use [@transak/transak-sdk](https://www.npmjs.com/package/@transak/transak-sdk) (Transak’s JavaScript SDK). Add the Transak SDK as a dependency using yarn or npm:

# Using yarn
$ yarn add @transak/transak-sdk

# Using npm
$ npm install @transak/transak-sdk

For the advance customization, view our query parameter documentation.

Example usage

import transakSDK from '@transak/transak-sdk'

let transak = new transakSDK({
    apiKey: '4fcd6904-706b-4aff-bd9d-77422813bbb7',  // Your API Key (Required)
    environment: 'STAGING', // STAGING/PRODUCTION (Required)
    defaultCryptoCurrency: 'ETH',
    walletAddress: '', // Your customer wallet address
    themeColor: '000000', // App theme color in hex
    email: '', // Your customer email address (Optional)
    redirectURL: '',
    hostURL: window.location.origin, // Required field
    widgetHeight: '550px',
    widgetWidth: '450px'
});

transak.init();

// To get all the events
transak.on(transak.ALL_EVENTS, (data) => {
		console.log(data)
});

// This will trigger when the user closed the widget
transak.on(transak.EVENTS.TRANSAK_WIDGET_CLOSE, (orderData) => {
    transak.close();
});

// This will trigger when the user marks payment is made.
transak.on(transak.EVENTS.TRANSAK_ORDER_SUCCESSFUL, (orderData) => {
    console.log(orderData);
    transak.close();
});

For in-depth instructions on integrating Transak, view our complete documentation.

transak-sdk's People

Contributors

agarwalyeshu avatar harshit00027 avatar jakeloo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.