Members
NoAuthPathsArray.<string>
An Array of Paths (Relative URLs) that do not require Authentication
Type
-
Array.<string>
Source
Versionstring
The Library Version
Type
-
string
Source
Methods
apiAccountLogin(key, secret, providerIdopt) → {Promise.<string>}
Generates a new JWT for an API Account
Parameters
-
key
stringThe API Key
-
secret
stringThe API Secret
-
providerId
string<optional>
The Service Provider ID
Returns
-
Promise.<string>
Source
disableDebugMode()
Disable Debugging Mode
Source
enableDebugMode()
Enable Debugging Mode
Source
getBaseURL() → {string}
Returns the Base URL
Returns
-
string
Source
getToken() → {string|undefined}
Returns the JSON Web Token
Returns
-
stringundefined
Source
getWebSocketPort() → {number}
Returns the WebSocket Port
Returns
-
number
Source
getWebSocketServer() → {string}
Returns the WebSocket Server URL
Returns
-
string
Source
hasToken() → {boolean}
Returns whether a valid JSON Web Token exists
Returns
-
boolean
Source
initialize(tokenopt)
Initializes the API Client. If a JSON Web Token is provided, no further Authentication steps are required. If no JWT is provided, a User Account or API Account Login must be completed next.
Parameters
-
token
string<optional>
An optional JSON Web Token to Initialize the API with.
Throws
-
The JSON Web Token provided was not valid
- Type
-
Error
Source
isDebugMode() → {boolean}
Returns the Debugging Mode
Returns
-
boolean
Source
isDefined(variable) → {boolean}
Determines if a Variable has been Defined
Parameters
-
variable
any
Returns
-
boolean
Source
isInitialized() → {boolean}
Returns the Initialized Status
Returns
-
boolean
Source
isJwtValid(jwt) → {boolean}
Parameters
-
jwt
string|undefinedThe JWT Token
Returns
-
boolean
Source
lock() → {Promise.<boolean>}
Locks an existing JWT
Returns
-
Promise.<boolean>
Source
logout() → {Promise.<boolean>}
Destroys an existing JWT
Returns
-
Promise.<boolean>
Source
passwordUnlock(password) → {Promise.<boolean>}
Unlocks an existing JWT using a Password
Parameters
-
password
stringThe User's Password
Returns
-
Promise.<boolean>
Source
pinCodeUnlock(pinCode) → {Promise.<boolean>}
Unlocks an existing JWT using a Pin Code
Parameters
-
pinCode
stringThe User's Pin Code
Returns
-
Promise.<boolean>
Source
ping() → {Promise.<boolean>}
"Pings" the API
Returns
-
Promise.<boolean>
Source
setBaseURL(url)
Set the Base URL
Parameters
-
url
stringThe Base URL String
Source
setToken(jwt)
Set the JSON Web Token
Parameters
-
jwt
string|undefinedThe JSON Web Token
Throws
-
The JSON Web Token provided was not valid
- Type
-
Error
Source
setWebSocketPort(port)
Set the WebSocket Port
Parameters
-
port
numberThe WebSocket Port Number
Source
setWebSocketServer(url)
Set the WebSocket Server URL
Parameters
-
url
stringThe WebSocket Server URL
Source
userAccountLogin(email, password, providerIdopt) → {Promise.<string>}
Generates a new JWT for a User Account
Parameters
-
email
stringThe User's Email Address
-
password
stringThe User's Password
-
providerId
string<optional>
The Service Provider ID
Returns
-
Promise.<string>