RTSDK
    Preparing search index...

    Class UserInventoryItem

    Controller for a user's owned inventory item.

    This class should be instantiated via UserInventoryItemFactory only. UserInventoryItem represents an instance of an InventoryItem owned by a specific user or visitor. It includes ownership details like quantity, grant_source, and user-specific metadata.

    inventory, item, user, visitor, owned, granted

    Hierarchy (View Summary)

    Implements

    Index

    Inventory

    • Fetches the inventory item details from the platform and assigns them to this instance.

      Returns Promise<InventoryItem>

      Returns this InventoryItem instance with all properties populated from the platform.

      get, fetch, retrieve, load, inventory, item, details

      await item.fetchInventoryItemById();
      const { name, description, type } = item;
    • Fetches the user inventory item details from the platform and assigns them to this instance.

      Returns Promise<void>

      Populates this UserInventoryItem instance with all properties from the platform.

      get, fetch, retrieve, load, user, inventory, item, details, owned

      await userInventoryItem.fetchUserInventoryItemById();
      const { quantity, grant_source, item } = userInventoryItem;

    Other

    created_at?: Date
    credentials: undefined | InteractiveCredentials
    description?: string
    grant_source: string
    id: string
    image_path?: string
    image_url: string
    interactive_key_id?: string
    item_id: string
    jwt?: string
    metadata?: null | object
    name?: string
    profile_id?: null | string
    quantity: number
    requestOptions: object
    status?: string
    topia: Topia
    type: string
    updated_at?: Date
    user_id: string
    userItemId: string
    • Standardized error handler for all SDK operations.

      Parameters

      • __namedParameters: { error?: unknown; message?: string; params?: object; sdkMethod?: string }

      Returns {
          data: {};
          message: string;
          method: string;
          params: object;
          sdkMethod: undefined | string;
          stack: string;
          stackTrace: Error;
          status: number;
          success: boolean;
          url: string;
      }

      Standardized error object with properties: data, message, method, params, sdkMethod, stack, status, success, url

      This method processes errors from API calls and formats them consistently across the SDK. It extracts relevant error information including:

      • HTTP status codes and response data
      • Error messages from API responses
      • Stack traces for debugging
      • Request details (URL, method, parameters)

      All errors thrown by SDK methods flow through this handler to ensure consistent error format.

      error, exception, handler, debugging, api error, http error

    • Returns the configured Axios instance for making API calls to Topia's Public API.

      Returns AxiosInstance

      The configured Axios client instance with authentication headers.

      All HTTP requests to the Topia API should use this method to ensure proper authentication headers and base URL configuration are applied.

      api, axios, http, request, client, public api