Bootstrap the littleBits Cloud APIs into a client app
component install littlebits/cloud-api
bootstrap :: Options, (err, api_http ->) ->
A configuration object that is passed through to:
oauth2-implicit
options, refer to https://github.com/jasonkuhrt/oauth2-implicit#options--cloud-client-api-http
defaults, refer to https://github.com/littlebits/cloud-client-api-http#set
A callback that is executed once oauth2-implicit
has completed. Behind the scenes api_http
is loaded with the credentials.accessToken
attained by oauth2-implicit
.
err
Any error fromoauth2-implicit
(https://github.com/jasonkuhrt/oauth2-implicit#callback--err-credentials---void), ornull
.api_http
An "instance" ofcloud-client-api-http
that has had the received credentials applied to its.defaults()
. Its ready to go, request away!
======
Is cloud-client-api-http
. For docs refer to https://github.com/littlebits/cloud-client-api-http.
Normally you will acquire api_http
from .bootstrap
since automatic authorization setup is very convenient. There is no known pattern/use-case for accessing api_http
directly, but it is there for whe you discover that reason.