Setup Guide
Bridge Widget
The Bridge widget is a drop-in framework that handles on\off ramping of NGN. It works with vanilla JavaScript and all major JavaScript frameworks.
Getting Started
Sign up at (ngnc.online/user/kyb), once your NGNC account has been activated you will be eligible to access NGNC Bridge and customize the bridge widget to fit your business.
Update your Bridge widget setup with your public key from the bridge credentials page.
Installation
Using NPM
Using Yarn
Using unpkg CDN
Import it into your project
Parameters
type
key
This is your Bridge public key from the Bridge dashboard
Your key is required
type
Enter the transaction type (buy / sell)
The type of transaction is required
data
Parse in the transaction data to be sent
The data object is required
onSuccess
This function is triggered when a user successfully performs a transaction.
This function is required
onLoad
This function is invoked when the widget has been mounted unto the DOM. You can handle toggling your trigger button within this callback.
onEvent
This method is called when certain events in the NGNC Bridge flow have occurred, for example, when the widget launches or when a transaction is successfully complete. This enables your application to gain further insight into the NGNC Bridge onboarding flow.
onClose
This function is called when the user exit the bridge widget flow.
setup()
This method is used to load the widget onto the DOM, the widget remains hidden after invoking this function until the open()
method is called.
open()
This method makes the widget visible to the user.
Event Name
Event names correspond to the type key returned by the raw event data. Possible options are in the table below.
OPENED
Triggered when the user opens the Bridge Widget.
AUTH__CREDENTIALS
Triggered when authenticating the API key
AUTH__SUCCESS
Triggered when the API key is valid
ERROR
Triggered when the widget reports an error.
NETWORK__SELECTED
Triggered when the user selects a network
LINKTAG__FOUND
Triggered when the users LINK_Tag is valid
TRANSACTION__SUCCESS
Triggered when a transaction is successful
TRANSACTION__FAILED
Triggered when a transaction fails
Last updated