Biconomy SDK
Search…
⌃K

Enable Fiat On-Ramp & Off-Ramp

BiconomySDK's Transak library is one for developers who want to on-ramp and off-ramp solutions and don't want to go through with all steps to integrate the SDK. It is a typescript wrapper on transak.js SDK which abstract few steps for the developers and users.

Steps to Enable Fiat On-Ramp & Off-Ramp

  • Import the @biconomy-sdk/transak package in your project.
import Transak from "@biconomy/transak";
  • Initialise the project without going to any dashboard
// init the widget
const transak = new Transak('STAGING');
transak.init();
  • If you are using Biconomy's Social Login along with Fiat On Ramp then you can directly pass in the email like so:
import SocialLogin from '@biconomy/web3-auth';
import Transak from '@biconomy/transak';
// initialise social login
const socialLoginSDK = new SocialLogin();
await socialLoginSDK.init('0x5');
socialLoginSDK.showConnectModal();
socialLoginSDK.showWallet();
// after login get the user info
const userInfo = await socialLoginSDK.getUserInfo();
// use this info for transak package
const transak = new Transak('STAGING', {
walletAddress: userAddress,
userData: {
firstName: userInfo?.name || '',
email: userInfo?.email || '',
},
});
transak.init();
  • On transak.init() Transak widget opens and users can buy on ramp.

Code Examples