User friendly web interface to make use of Paybook's Sync services.
Sync Widget can be installed via npm. It is recommended to get Sync Widget this way.
npm install --save @paybook/sync-widget
Note: You'll need to have npm 2.7.0 or greater installed, since this library is hosted as a scoped package.
Import styles
import "@paybook/sync-widget/dist/widget.css";
Import SyncWidget class
import SyncWidget from "@paybook/sync-widget";
To create an instance of SyncWidget, you need to create an element in the DOM with a unique selector. By default SyncWidget will search for "#widget". Here's an example.
<div id="widget"></div>
Note: The widget will replace this element.
Once you have the element, you're ready to instantiate a new SyncWidget with your desired configuration.
// Any of the following formats may be used
var syncWidget = new SyncWidget("sync_token");
var syncWidget = new SyncWidget({
token: "sync_token"
});
var syncWidget = new SyncWidget({
token: "sync_token",
element: "#widget",
config: {
locale: "es",
entrypoint: {
country: "MX"
}
}
});