Reference for Item and ServerItem types for managing quantifiable resources.
Items represent quantifiable resources in your application, such as credits, API calls, storage quotas, or subscription allowances. They can be associated with users, teams, or custom customers and are managed through Hexclave’s payment system.On this page:
The Item type represents a quantifiable resource that can be consumed or managed within your application. Items are typically obtained through purchases, subscriptions, or manual allocation.Items can be retrieved through:
The ServerItem type extends Item with additional server-side methods for modifying quantities. This type is only available in server-side contexts and provides race-condition-safe operations for managing item quantities.Server items can be retrieved through:
The tryDecreaseQuantity() method is particularly valuable for prepaid credit
systems where operations require sufficient balance verification before
proceeding.
Assistant
Responses are generated using AI and may contain mistakes.