userToken
and provide this when initializing the Kana JS Client instance in order for calls to be successfully made. We have a handy guide which goes into further detail on how to obtain and provide this.
Authorization (Frontend)
error
field of a request. You can use the following to assign the relevant fields to a data
or error
variable and check against them to understand if problems occurred or if data was returned:
onError
argument with an async function when initializing the client in order to globally take actions when errors occur. The following example logs all errors upon one occurring:
EmptyArgumentError
FeatureNotFoundError
AuthenticationError
NetworkError
Error
NetworkError
occurs with no backoff or delay. You can override this behaviour with the retry
argument:
access
boolean is true
when the user has access (for Binary features), has enough of a feature remaining to be used (for Consumable features), or has overage enabled (for Consumable features).
Field | Type | Text |
---|---|---|
featureId | String! | The id of the feature. This maps to the id field as set on the Feature object. |
delta | Int | The amount of the consumable feature which the user will be using and you want to check access against. Defaults to 1 . |
Promise
that resolves to a CanUseFeatureData object.
Promise
that resolves to an array of Feature objects with only the following fields present:
id
name
type
unitLabel
unitLabelPlural
metadata
Promise
that resolves to an array of Package objects with only the following fields present:
id
name
isAddon
metadata
resetCache()
in order to refresh this data.
Promise
that resolves to an empty object if the cache has been successfully reset.