React and Vue Examples
How to integrate IntaSend payment in your JavaScript web framework.

How to add IntaSend to any Javascript project

1. Install SDK

IntaSend inlinejs-sdk is available using yarn or npm
1
yarn add intasend-inlinejs-sdk
Copied!

2. Import IntaSend in your code

1
const IntaSend = require("intasend-inlinejs-sdk")
Copied!

3. Initialize

You'll need your publicAPIKey and ensure the live flag is well set depending on your environment.
1
const intaSendInstance = new IntaSend({
2
publicAPIKey: "<YOUR-API-KEY>",
3
live: true //or false for sandbox environment
4
})
5
Copied!

4. Load payment screen

The .run() the method will load the payment popup. Feel free to set the payment setting e.g the amount and currency based on your need. Here is a reference of options you can add.
1
// Load payment popup with the run() function
2
intaSendInstance.run({amount: 10, currency: "USD"})
Copied!

5. Capture results

Finally, do something on payment complete or failure.
1
intaSendInstance
2
.on("COMPLETE", (results) => alert("COMPLETE"))
3
.on("FAILED", (results) => alert("FAILED"))
Copied!
Last modified 1mo ago