Widget Guide
Installation
Using NPM
npm install @ngnc/bridge
Using Yarn
yarn add @ngnc/bridge
UsingunpkgCDN
<script src="https://unpkg.com/@ngnc/bridge"></script>
Import it into your project
import Bridge from "@ngnc/bridge"
Parameters
key
type
data
onLoad
onSuccess
onEvent
onClose
Import it into your project
import Bridge from "@ngnc/bridge"
Initialize Widget
- Input your Bridge public key from the Bridge dashboard
- Enter the transaction type (buy / sell).
- Parse in the transaction data to be sent
const widget = new Bridge({
key: "Bridge_Public_Key",
type: "TYPE",
currency: "ngn" || "usd,
data: {
amount: "3000",
network: "Stellar",
wallet_address: "link_test@stellar",
type: "sell"
}
onSuccess: (response) => console.log(response),
onLoad: () => console.log("Bridge widget loaded successfully")
})
widget.setup();
widget.open();
Updated 5 days ago