lookup-y-oauth-js

Customized version of OAuth.io JavaScript SDK

Usage no npm install needed!

<script type="module">
  import lookupYOauthJs from 'https://cdn.skypack.dev/lookup-y-oauth-js';
</script>

README

lookup-oauth-js

Customized version of OAuth.io JavaScript SDK.

Customization changes

The last change is done in pretty clumsy way (will be appreciate for more elegant hint): in core.coffee getJquery is modified to return global jQuery variable - so it works in assumption, that global jQuery is available.

If you are using RequireJS config can look like:

{
    shim: {
        'jquery': {
            exports: 'jQuery'
        },
        'oauth-js': {
            deps: ['jquery'],
            exports: 'OAuth'
        }
    },
    paths: {
        'jquery': 'libs/jquery/dist/jquery',
        'oauth-js': 'libs/lookup-oauth-js/dist/oauth'
    }
}

...and futher using like:

define(['oauth-js'], function (OAuth) {
    OAuth.initialize(YOUR_OAUTHD_KEY);
    OAuth.popup(PROVIDER_NAME).done(function (result) {
        console.log('result: %o', result);
        result.me().done(function (data) {
            console.log('data: %o', data);
            alert('Hello ' + data.name + '!');
        }).fail(function (err) {
            console.log(err);
        });
    }).fail(function (err) {
        console.log(err);
    });
});

Versions

2015-08-13: initital 0.4.3 version 2015-08-13: 0.4.4 version: removing Q dependency; dist file size decreased (uncompressed: 115 kB -> 52 kB)

License

This SDK is published under the Apache2 License.

More information in oauth.io documentation