Class: Asset
resources/assets.AssetClient
The AssetClient is used to manage digital assets within the Spaceport ecosystem. Assets are the core digital items, such as 3D models, audio files, or other creative works, that can be licensed and monetized. This client handles creating and managing the metadata and files associated with these assets.
Table of contents
Methods
constructor
• new AssetClient(client
): AssetClient
Parameters
Name | Type |
---|---|
client | SpaceportSDK |
Returns
Methods
create
▸ create(params
): Promise
<CreateAssetResponse
>
Creates an asset record. This method creates the asset metadata and returns the full asset data that can be used for listings and other operations.
Parameters
Name | Type | Description |
---|---|---|
params | CreateAssetParams | Parameters for creating the asset record. |
Returns
Promise
<CreateAssetResponse
>
Object containing success status, the created asset ID, and full asset data.
Example
batchCreate
▸ batchCreate(params
): Promise
<BatchCreateAssetsResponse
>
Creates multiple asset records. This method creates multiple asset metadata records and returns the full asset data for each successfully created asset.
Supports both JSON-only requests and file uploads.
Parameters
Name | Type | Description |
---|---|---|
params | BatchCreateAssetsParams | Parameters for batch creating asset records. |
Returns
Promise
<BatchCreateAssetsResponse
>
Object containing success status, created assets data, and any errors.
Example