RTSDK
    Preparing search index...

    Class Asset

    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" }
    });

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    credentials: undefined | InteractiveCredentials
    id?: string
    jwt?: string
    requestOptions: object
    topia: Topia

    Methods

    • 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;
      }

    • Retrieves platform asset details and assigns response data to the instance.

      Returns Promise<object | ResponseType>

      Returns the asset details or an error response.

      await asset.fetchAssetById();
      const { assetName } = asset;
    • Returns AxiosInstance

    • Updates platform asset details.

      Parameters

      • __namedParameters: {
            assetName: string;
            bottomLayerURL?: string;
            creatorTags: object;
            isPublic: boolean;
            shouldUploadImages?: boolean;
            tagJson: string;
            topLayerURL?: string;
        }

      Returns Promise<void | ResponseType>

      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;