Create an instance of Asset class with a given asset id and optional attributes and session credentials.
const asset = await new Asset(topia, "id", { attributes: { assetName: "My Asset", isPublic: false }, credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }}); Copy
const asset = await new Asset(topia, "id", { attributes: { assetName: "My Asset", isPublic: false }, credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }});
Optional
Readonly
Retrieves platform asset details and assigns response data to the instance.
Returns the asset details or an error response.
await asset.fetchAssetById();const { assetName } = asset; Copy
await asset.fetchAssetById();const { assetName } = asset;
Updates platform asset details.
await asset.updateAsset({ assetName: "exampleAsset", bottomLayerURL: null, creatorTags: { "decorations": true }, isPublic: true, shouldUploadImages: true, tagJson: "[{"label":"decorations","value":"decorations"}]", topLayerURL: "https://example.topLayerURL" });const { assetName } = asset; Copy
await asset.updateAsset({ assetName: "exampleAsset", bottomLayerURL: null, creatorTags: { "decorations": true }, isPublic: true, shouldUploadImages: true, tagJson: "[{"label":"decorations","value":"decorations"}]", topLayerURL: "https://example.topLayerURL" });const { assetName } = asset;
Create an instance of Asset class with a given asset id and optional attributes and session credentials.
Example