Class: Account

Account(apiKeyopt)

Account API client. Retrieves the current account's profile, quota and usage.

Constructor

new Account(apiKeyopt)

Create a new Account API client.
Parameters:
Name Type Attributes Default Description
apiKey string | null <optional>
null Your API key. If omitted, the `IDANALYZER_KEY` environment variable is used.
Source:

Extends

Methods

(async) getAccount() → {Promise.<ApiResponse>}

Retrieve current account profile, quota and usage.
Source:
Returns:
The parsed API response containing account profile, quota and usage.
Type
Promise.<ApiResponse>

getApiKey(customKeyopt) → {string|null}

Resolve the API key, preferring the provided value and falling back to the `IDANALYZER_KEY` environment variable.
Parameters:
Name Type Attributes Default Description
customKey string | null <optional>
null Explicitly supplied API key.
Overrides:
Source:
Returns:
The resolved API key, or `null` if none is available.
Type
string | null

setParam(key, value) → {void}

Set an API parameter and its value, this function allows you to set any API parameter without using the built-in functions
Parameters:
Name Type Description
key string Parameter key
value * Parameter value
Overrides:
Source:
Returns:
Type
void

throwApiException(swopt) → {void}

Whether an exception should be thrown if API response contains an error message
Parameters:
Name Type Attributes Default Description
sw boolean <optional>
false Set to `true` to throw an APIError when the API response contains an error, or `false` to return the raw error response instead.
Overrides:
Source:
Returns:
Type
void