ngnc-bridge-link v1.0.0
Table of Content
Links
Installing
Using npm:
npm install @ngnc/bridge
Using yarn:
yarn add @ngnc/bridge
Using jsDelivr CDN:
<script src=""></script>
Examples
React implementation
import Bridge from "@ngnc/bridge";
export const Transaction = () => {
const widget = new Bridge({
key: "NGNC__KEY",
entity: "ENTITY",
});
widget.setup();
widget.open();
};
Paramenters
- key
- entity
- onLoad
- onSuccess
- onEvent
- onClose
key
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
entity
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
onLoad
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
onSuccess
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
onEvent
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
onClose
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
2 years ago