Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@transak/transak-sdk

Package Overview
Dependencies
Maintainers
5
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@transak/transak-sdk - npm Package Compare versions

Comparing version 1.4.1 to 2.0.0-rc.0

lib/index.cjs

87

package.json
{
"name": "@transak/transak-sdk",
"version": "1.4.1",
"description": "Transak SDK that allows you to easily integrate the fiat on/ramp",
"main": "dist/sdk.js",
"version": "2.0.0-rc.0",
"description": "Transak SDK that allows you to easily integrate fiat on/off ramp",
"type": "module",
"types": "lib/index.d.ts",
"main": "lib/index.cjs",
"exports": {
".": {
"import": {
"types": "./lib/index.d.ts",
"default": "./lib/index.js"
},
"require": {
"types": "./lib/index.d.cts",
"default": "./lib/index.cjs"
}
}
},
"files": [
"lib/**/*"
],
"engines": {
"node": ">=16.0.0"
},
"scripts": {
"eslint": "eslint . --ext .js,.jsx,.ts,.tsx",
"eslint": "eslint . --ext .ts",
"eslint:fix": "yarn eslint --fix",
"build": "browserify ./src/index.js -o ./dist/sdk.js -p esmify -s TransakSDK"
"build": "tsc && tsup",
"prepack": "yarn run build"
},
"author": "Transak",
"license": "ISC",
"repository": {
"url": "https://github.com/Transak/transak-sdk"
},
"engines": {
"node": ">=10.0.0"
},
"author": "Transak",
"license": "ISC",
"keywords": [
"crypto",
"cryptocurrency",
"fiat",
"on",
"off",
"ramp"
],
"dependencies": {
"@types/events": "^3.0.1",
"events": "^3.3.0",
"pako": "^2.1.0",
"query-string": "^8.1.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"browserify": "^17.0.0",
"eslint": "^8.49.0",
"@types/pako": "^2.0.1",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"eslint": "^8.50.0",
"eslint-config-airbnb-base": "^15.0.0",

@@ -44,19 +56,18 @@ "eslint-config-airbnb-typescript": "^17.1.0",

"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-testing-library": "^6.0.1",
"eslint-plugin-vitest": "^0.3.1",
"esmify": "^2.1.1",
"typescript": "^5.2.2"
"eslint-plugin-testing-library": "^6.0.2",
"eslint-plugin-vitest": "^0.3.2",
"prettier": "^3.0.3",
"tsup": "^7.2.0",
"typescript": "^5.2.2",
"vitest": "^0.34.6"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
"keywords": [
"crypto",
"cryptocurrency",
"fiat",
"on",
"off",
"ramp"
],
"packageManager": "yarn@3.6.3"
}
# Transak SDK
A JavaScript library for decentralised applications to onboard their global user base with fiat currency.
A library for decentralised applications to onboard their global user base with fiat currency.

@@ -17,18 +17,18 @@ ## Installation

Refer here for the full list of [customisation options](https://docs.transak.com/docs/query-parameters)
```ts
import { TransakConfig, Transak } from '@transak/transak-sdk';
```js
import transakSDK from '@transak/transak-sdk';
let transak = new transakSDK({
const transakConfig: TransakConfig = {
apiKey: '<your-api-key>', // (Required)
environment: '<environment: STAGING/PRODUCTION>', // (Required)
environment: Transak.ENVIRONMENTS.STAGING/Transak.ENVIRONMENTS.PRODUCTION, // (Required)
// .....
// For the full list of customisation options check the link above
});
// For the full list of customisation options check the link below
};
let transak = new Transak(transakConfig);
transak.init();
// To get all the events
transak.on(transak.ALL_EVENTS, (data) => {
Transak.on('*', (data) => {
console.log(data);

@@ -38,9 +38,21 @@ });

// This will trigger when the user closed the widget
transak.on(transak.EVENTS.TRANSAK_WIDGET_CLOSE, (orderData) => {
transak.close();
Transak.on(Transak.EVENTS.TRANSAK_WIDGET_CLOSE, () => {
console.log('Transak SDK closed!');
});
// This will trigger when the user marks payment is made
transak.on(transak.EVENTS.TRANSAK_ORDER_SUCCESSFUL, (orderData) => {
/*
* This will trigger when the user has confirmed the order
* This doesn't guarantee that payment has completed in all scenarios
* If you want to close/navigate away, use the TRANSAK_ORDER_SUCCESSFUL event
*/
Transak.on(Transak.EVENTS.TRANSAK_ORDER_CREATED, (orderData) => {
console.log(orderData);
});
/*
* This will trigger when the user marks payment is made
* You can close/navigate away at this event
*/
Transak.on(Transak.EVENTS.TRANSAK_ORDER_SUCCESSFUL, (orderData) => {
console.log(orderData);
transak.close();

@@ -50,2 +62,8 @@ });

For in-depth instructions on integrating Transak, view [our complete documentation.](https://docs.transak.com)
Refer here for the full list of [customisation options](https://docs.transak.com/docs/query-parameters)
For in-depth instructions on integrating Transak, view [our complete documentation.](https://docs.transak.com/docs/integration-options)
## Migration Guide for v2
[This guide](https://github.com/Transak/transak-sdk/wiki/Migration-Guide-for-v2) will help you to upgrade to v2 successfully!
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc