title |
---|
HelloJs Modules |
HelloJS is extensible, i.e. you can add new services to it as long as you can get your head around the important parts.
A module defines a providers Authorisation and RESTful endpoints. It translates the API's nuances for the provider to closely match those of its peers with similar features.
The table shows the services which are already documented on HelloJS. Simply include these scripts in your page after your HelloJS script tag.
Modules are loaded into HelloJS using the hello.init() method, with a JSON object that has the name of the service as the only key and then whose value consists of an object with the following properties.
name | type | example | description | argument | default | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
oauth |
Object
|
required | |||||||||||||||||||||
login | function | A function to augment the login request. | optional | ||||||||||||||||||||
refresh | Boolean | Indicate that the providers supports silent signin, aka display=none, however if a refresh_token was proffered at signin, then an attempt will be made with that. | optional | false | |||||||||||||||||||
scope | Object | A dictionary of key and value (the providers sudonym or name of comparative scope) | optional | ||||||||||||||||||||
scope_delim | string |
,, |
Overrides the default delmiter between multiple scopes | optional | , |
||||||||||||||||||
base | url |
Prefix for all API requests | required | ||||||||||||||||||||
get,post,put,del | Object | Map of standardized pathnames to an alternative path, or path rendering function, the key 'default' will be used where the path is unrecognised, see examples | optional | ||||||||||||||||||||
wrap | Object | Map containing response processing handlers, the key 'default' will be used where the path is unrecognised. | optional | ||||||||||||||||||||
xhr, jsonp, form | function | A function called if the browser supports the method requests. Use this function to augment the request. Return truthy value to proceed or false to fallback to another method. | optional | true |
That would be fantastic if you could. Please make the following updates so its easiy for people to discover and test.
- Fork the code from GitHub
- Name your script with the label you want it to be identified with and use this as the key name of module settings above
- Add your module to tests/hello.all.js
- Check your script passes the test in as many browsers as you can.
- Update the list of services above with a name and link, also get credit for your hard work by including your name