Skip to content

A javascript library for connecting to Metry user's consumption data via OAuth 2.0

Notifications You must be signed in to change notification settings

FrontEdgeIT/metry-oauth-connect-nojquery

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

metry-oauth-connect

A javascript library for connecting to Metry user's consumption data via OAuth 2.0

jQuery dependency removed by FrontEdge IT AB, now only relies on native JavaScript functionality.

Demo

There is a demo available where you can test the button. Use your own Metry-account to approve access. If you don't have one you can register at https://metry.io

Configuration

var metry = new MetryoAuthConnect({
    clientSecret : 'demopass',
    clientId     : 'demoapp',
    redirectUri  : location.origin + location.pathname,
    onSuccess    : function(token) {
        console.info('Got the Metry oAuth tokens!');
        console.info(token);
    }
});

Give any button/link a data-metry="authenticate" attribute and the oAuth authentication process will start.

For now you can use the demoapp/demopass client id/secret while you're testing your implementation. Contact Metry (http://support.metry.io) to get started with your own clientId and clientSecret

Metry oAuth 2.0 endpoints

If you decide to roll your own implementation, keep in mind the oAuth endpoints for Metry:

Description Url
Host https://app.metry.io/
oAuth 2.0 Authorize https://app.metry.io/oauth/authorize
oAuth 2.0 Token https://app.metry.io/oauth/token

Making API requests

Got your access_token? Then it's time to make those API calls to Metry. See our detailed documentation on http://docs.metry.apiary.io

About

A javascript library for connecting to Metry user's consumption data via OAuth 2.0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 58.6%
  • HTML 41.4%