@syncfy/authentication-widget
v0.0.6
Published
User friendly web interface to make use of Syncfy services.
Downloads
11
Readme
Sync Widget
User friendly web interface to make use of Syncfy services.
Quick Start
Installation
Syncfy authentication widget can be installed via npm. It is recommended to get Syncfy authentication widget this way.
npm install --save @syncfy/authentication-widget
Note: You'll need to have npm 2.7.0 or greater installed, since this library is hosted as a scoped package.
Integration
Using bundlers (Webpack)
Import styles
import "@syncfy/authentication-widget/dist/style.css";
Import SyncfyWidget class
import SyncfyWidget from "@syncfy/authentication-widget";
Usage
Creating an instance
To create an instance of SyncfyWidget, you need to create an element in the DOM with a unique selector. By default SyncfyWidget will search for "#widget". Here's an example.
<div id="widget"></div>
Once you have the element, you're ready to instantiate a new SyncfyWidget with your desired configuration.
// Any of the following formats may be used
var syncfyWidget = new SyncfyWidget("syncfy_token");
var syncfyWidget = new SyncfyWidget({
token: "syncfy_token"
});
var syncfyWidget = new SyncfyWidget({
token: "syncfy_token",
element: "#widget",
config: {
locale: "es",
entrypoint: {
country: "MX"
}
}
});