quota
Configuration of the quota manager used for this component. Quotas allow you to throttle the firing of your component. This is especially useful and many times even necessary to make sure you don't go over the limits of the usage of the API that you call in your components. Quota managers are defined in the quota.js
file of your service/module. Example:
Dynamic values
The {{}}
can be used in any property within the quota definition. And values from two objects - the user's metadata, and the account's profileInfo can be used there. The following example shows how to dynamically select a resource
based on the value of user's metadata
.tier
.
The quota.js file with the rules for the previous example could look like this:
The other object that can be used here, is the profileInfo.
quota.manager
The name of the quota module where usage limit rules are defined.
quota.resources
One or more resources that identify rules from the quota module that apply to this component. Each rule in the quota module can have the resource
property. quota.resources
allow you to cherry-pick rules from the list of rules in the quota module that apply to this component. quota.resources
can either be a string or an array of strings.
Dynamic values. Sometimes different users have different quotas for the same service.
quota.scope
This scope instructs the quota manager to count calls either for the whole application (service) or per-user. Currently, it can either be omitted in which case the quota limits for this component apply to the whole application or it can be { "userId": "{{userId}}" }
in which case the quota limits are counted per Appmixer user.
Last updated
Was this helpful?