Opens a login modal, asking for the user to login/create an account, and in case of success, it will close and return
a valid authorization code.
Usage
blinkSDK.getAuthorizationCode(
(response) => {
console.log("Successfully got the authorization code: " + response.code);
},
(error) => {
const {code, message} = error;
console.log("Error while trying to login: " + message);
});
Signature
blinkSDK.getAuthorizationCode(callback, [errorCallback])
Parameters
| parameter | type | required | description |
callback | function | ☑ | Called in case of success, will receive a response object containing the authorization code |
errorCallback | function | ☐ | Called in case of error, will receive an error object containing the error details |
Returns
void
Objects definitions
Response object
{
"code" :
}
| name | type | description |
code | string | A valid authorization code |
Error object
{
"code" :
"message" :
}
| name | type | description |
code | integer | Error code |
message | string | Error message |