Using npm:
npm install @ngnc/bridge
Using yarn:
yarn add @ngnc/bridge
Using jsDelivr CDN:
<script src=""></script>
import Bridge from "@ngnc/bridge";
export const Transaction = () => {
const widget = new Bridge({
key: "NGNC__KEY",
entity: "ENTITY",
});
widget.setup();
widget.open();
};
- key
- entity
- onLoad
- onSuccess
- onEvent
- onClose
This is your Entity name from in your credentials.json file credentials.json
file
const widget = new Bridge({ key: "NGNC__KEY" });
Note: Your key is required
An Entity is the name of your platform or project.
const widget = new Bridge({
key: "NGNC__KEY",
entity: "ENTITY",
});
Note: This is your Entity name from in your credentials.json file and it is required
This function is invoked when the widget has been mounted unto the DOM. You can handle toggling your trigger button within this callback.
const widget = new Bridge({
key: "NGNC__KEY",
entity: "ENTITY",
onLoad: () =>console.log("bridge widget loaded successfully");
});
Note: This function is optional
This function is triggeres when a user successfully performs a transaction.
const widget = new Bridge({
key: "NGNC__KEY",
entity: "ENTITY",
onSuccess: (response) => console.log(response);
});
Note: This function is required
This function is called when certain events in the NGNC Bridge flow have occurred, for example, when the widget launches or completes authentication. This enables your application to gain further insight into the NGNC Bridge onboarding flow.
const widget = new Bridge({
key: "NGNC__KEY",
entity: "ENTITY",
onEvent: (eventName, eventDetail) => {
console.log(eventName);
console.log(eventDetail);
},
});
Note: This function is optional
This function is called when the user exit the bridge widget flow
const widget = new Bridge({
key: "NGNC__KEY",
entity: "ENTITY",
onClose: () => console.log("bridge widget has been closed"),
});
Note: This function is optional