0.6.1-weebly.1 • Published 7 years ago

widgeticjs v0.6.1-weebly.1

Weekly downloads
16
License
MIT
Repository
github
Last release
7 years ago

Client Library for the Widgetic API

This is a JavaScript client library for the Widgetic API, written in CoffeeScript, suitable for use in most browsers.

##Installation

In the browser

This library is available at https://widgetic.com/sdk/sdk.js so add the following script tag in the head section of your page:

<script type="text/javascript" src="https://widgetic.com/sdk/sdk.js"></script>

Usage

The documentation is available on the Widgetic Documentation website.

The library exposes a global Widgetic variable that you can use to interact with the SDK's functions.

The first step is to initialize the SDK with your Widgetic app_id and redirect_url:

Widgetic.init('<app_id here>','<redirect_url here>');

After this step you can login using the Widgetic.auth() function.

You can pass a Boolean parameter that indicates if a popup should be opened or you just want to check if user is logged in. Default will open popup.

This has promise support built-in using the aye library.

//Check if user is logged in
Widgetic.auth(false).then(function(){/*handle success*/},function(){/*handle fail*/});
//Open popup to login user
Widgetic.auth().then(function(){/*handle success*/},function(){/*handle fail*/});

After user is logged in you call the Widgetic API using Widgetic.api(url,method,data). This function returns a promise. For example if you want to grab user info:

Widgetic.api('users/me').then(function(data){/*handle success*/},function(error){/*handle fail*/});
0.6.1-weebly.1

7 years ago

0.6.1-weebly.0

7 years ago

0.6.1-weebly

7 years ago

0.6.1

7 years ago

0.6.2

7 years ago

0.5.28

8 years ago

0.5.24

8 years ago

0.5.22

8 years ago

0.5.20

8 years ago

0.5.15

9 years ago

0.5.9

9 years ago

0.5.7

9 years ago