1.3.1 • Published 1 year ago

@ngnc/bridge v1.3.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Table of Content

Links

Installing

Using npm:

npm install ngnc-bridge-link

Using yarn:

yarn add ngnc-bridge-link

Using jsDelivr CDN:

<script src=""></script>

Examples

React implementation

import Bridge from "ngnc-bridge-link";

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 -->

1.2.0

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

2 years ago