resources/products.ProductClient

The ProductClient manages the lifecycle of products, which represent the instantiation of a licensed asset on an external platform (e.g., a specific t-shirt on Roblox created from a licensed design). Products link the Spaceport asset and agreement to its real-world counterpart, enabling tracking and royalty calculations.

Table of contents

Methods

constructor

new ProductClient(client): ProductClient

Parameters

NameType
clientSpaceportSDK

Returns

ProductClient

Methods

findById

findById(productId, _params?): Promise<null | Product>

Finds a product by its ID

Parameters

NameTypeDescription
productIdstringThe ID of the product to find
_paramsFindProductParams-

Returns

Promise<null | Product>

Promise resolving to product details

findManyByIds

findManyByIds(productIds, _params?): Promise<Product[]>

Finds multiple products by their IDs in a single request

Parameters

NameTypeDescription
productIdsstring[]Array of product IDs to find
_paramsFindProductParams-

Returns

Promise<Product[]>

Promise resolving to array of product details

Example

const products = await sdk.products.findManyByIds(['123', '456', '789']);
console.log(`Found ${products.length} products`);

create

create(params): Promise<CreateProductResponse>

Creates products from agreement assets

Parameters

NameTypeDescription
paramsCreateProductParamsProduct creation parameters

Returns

Promise<CreateProductResponse>

Promise resolving to creation response