This library can be found on npm.
The recommended way to install this is through npm:
$ npm install --save veridu-angularjs-sdkOr through bower:
$ bower install --save veridu-angularjs-sdkVia scripts:
<script src="js/angular/angular.js" charset="utf-8"></script>
<script src="js/veridu-angularjs-sdk/dist/veridu-angularjs-sdk.min.js" charset="utf-8"></script>Via browserify:
require('angular');
require('veridu-angularjs-sdk');// On your App initialization
angular.module('YourApp', [
'veridu.angularjs.sdk'
]);
// On your App configuration phase
angular.module('YourApp').config(function (VeriduProvider){
VeriduProvider.client = 'YOUR_CLIENT_ID';
})
// On a controller
AppCtrl.$inject = ['Veridu'];
function AppCtrl(Veridu) {
var vm = this;
vm.getProfile = getProfile;
vm.login = login;
// fetches user profile
function getProfile() {
Veridu.API.fetch('GET', 'profile/' + Veridu.cfg.user).then(
function success(response) {
vm.profile = response.data;
},
function error() {
// error handling
}
);
}
// SSO Login
function login = Veridu.SSO.login;
}Facebook SSO:
<button type="button" ng-click="App.login('facebook')">Login with Facebook</button>Examples of basic usage are located in the file examples/index.html. It's highly recommended to take a look at it.
Latest code documentation can be found here.
- SSO in minutes
- Query endpoints easily
- Highly configurable
Have a bug or a feature request? Please open a new issue. Before opening any issue, please search for existing issues and read the Issue Guidelines, written by Nicolas Gallagher.
This SDK will be maintained under the Semantic Versioning guidelines as much as possible.
Releases will be numbered with the following format:
<major>.<minor>.<patch>
And constructed with the following guidelines:
- Breaking backward compatibility bumps the major (and resets the minor and patch)
- New additions without breaking backward compatibility bumps the minor (and resets the patch)
- Bug fixes and misc changes bumps the patch
For more information on SemVer, please visit http://semver.org/.
To run the tests, you must first install Karma globally, then install dependencies with npm install --dev then:
$ karma startCopyright © 2016 - Veridu Ltd - http://veridu.com