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
string
The API Key
-
secret
string
The 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
-
string
undefined
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
|undefined
The 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
string
The User's Password
Returns
-
Promise.<boolean>
Source
pinCodeUnlock(pinCode) → {Promise.<boolean>}
Unlocks an existing JWT using a Pin Code
Parameters
-
pinCode
string
The 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
string
The Base URL String
Source
setToken(jwt)
Set the JSON Web Token
Parameters
-
jwt
string
|undefined
The JSON Web Token
Throws
-
The JSON Web Token provided was not valid
- Type
-
Error
Source
setWebSocketPort(port)
Set the WebSocket Port
Parameters
-
port
number
The WebSocket Port Number
Source
setWebSocketServer(url)
Set the WebSocket Server URL
Parameters
-
url
string
The WebSocket Server URL
Source
userAccountLogin(email, password, providerIdopt) → {Promise.<string>}
Generates a new JWT for a User Account
Parameters
-
email
string
The User's Email Address
-
password
string
The User's Password
-
providerId
string
<optional>
The Service Provider ID
Returns
-
Promise.<string>