RTSDK
    Preparing search index...

    Class DroppedAsset

    Create an instance of Dropped Asset class with a given dropped asset id, url slug, and optional attributes and session credentials.

    const droppedAsset = await new DroppedAsset(topia, "1giFZb0sQ3X27L7uGyQX", "example", {
    attributes: { text: "My Dropped Asset" },
    credentials: { interactiveNonce: "exampleNonce", assetId: "droppedAssetId", visitorId: 1, urlSlug: "exampleWorld" }
    });

    Hierarchy (View Summary)

    Implements

    Index

    Data Objects

    • Retrieves the data object for a dropped asset.

      Parameters

      • OptionalappPublicKey: string
      • OptionalappJWT: string
      • OptionalsharedAppPublicKey: string
      • OptionalsharedAppJWT: string

      Returns Promise<void | ResponseType>

      Returns the data object or an error response.

      const dataObject = await droppedAsset.fetchDataObject();
      
    • Increments a specific value in the data object for a dropped asset by the amount specified. Must have valid interactive credentials from a visitor in the world.

      Parameters

      • path: string
      • amount: number
      • options: {
            analytics?: AnalyticType[];
            appJWT?: string;
            appPublicKey?: string;
            lock?: { lockId: string; releaseLock?: boolean };
            sharedAppJWT?: string;
            sharedAppPublicKey?: string;
        } = {}

      Returns Promise<void | ResponseType>

      Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id

      await droppedAsset.incrementDataObjectValue("key", 1);
      
    • Sets the data object for a dropped asset and assigns the response data to the instance.

      Parameters

      • dataObject: object
      • options: {
            analytics?: AnalyticType[];
            appJWT?: string;
            appPublicKey?: string;
            lock?: { lockId: string; releaseLock?: boolean };
            sharedAppJWT?: string;
            sharedAppPublicKey?: string;
        } = {}

      Returns Promise<void | ResponseType>

      Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id

      await droppedAsset.setDataObject(
      { resetCount: 0 },
      {
      analytics: [{ analyticName: "resets"} ],
      lock: { lockId: `${assetId}-${resetCount}-${new Date(Math.round(new Date().getTime() / 10000) * 10000)}` },
      },
      );

      const { resetCount } = droppedAsset.dataObject;
    • Updates the data object for a dropped asset and assigns the response data to the instance.

      Parameters

      • dataObject: object
      • options: {
            analytics?: AnalyticType[];
            appJWT?: string;
            appPublicKey?: string;
            lock?: { lockId: string; releaseLock?: boolean };
            sharedAppJWT?: string;
            sharedAppPublicKey?: string;
        } = {}

      Returns Promise<void | ResponseType>

      Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id

      await droppedAsset.updateDataObject({
      [`profiles.${profileId}.itemsCollectedByUser`]: { [dateKey]: { count: 1 }, total: 1 },
      [`profileMapper.${profileId}`]: username,
      });

      const { profiles } = droppedAsset.dataObject;

    Other

    credentials: undefined | InteractiveCredentials
    dataObject?: null | object
    id?: string
    interactivePublicKey?: null | string
    isInteractive?: null | boolean
    jwt?: string
    position: { x: number; y: number }
    requestOptions: object
    text?: null | string
    topia: Topia
    urlSlug: string
    • Add a webhook to a dropped asset

      Parameters

      • __namedParameters: {
            dataObject: object;
            description: string;
            isUniqueOnly: boolean;
            shouldSetClickType?: boolean;
            shouldSetIsInteractive?: boolean;
            title: string;
            type: string;
            url: string;
        }

      Returns Promise<void | AxiosResponse<any, any>>

      Returns the new webhookId or an error.

      await droppedAsset.addWebhook({
      dataObject: {},
      description: "Webhook desc",
      enteredBy: "you",
      isUniqueOnly: false,
      title: "title",
      type: "type",
      url: "https://url.com",
      });
    • 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;
    • Retrieve analytics for a dropped asset by day, week, month, quarter, or year

      Parameters

      • __namedParameters: {
            dateValue: number;
            periodType: "week" | "month" | "quarter" | "year";
            year: number;
        }

      Returns Promise<void | ResponseType>

      Returns the analytics data or an error.

      const analytics = await droppedAsset.fetchDroppedAssetAnalytics({
      periodType: "quarter",
      dateValue: 3,
      year: 2023,
      });
    • Retrieves dropped asset details and assigns response data to the instance.

      Returns Promise<void | ResponseType>

      await droppedAsset.fetchDroppedAssetById();
      const { assetName } = droppedAsset;
    • Flip an dropped asset.

      Returns Promise<void | ResponseType>

      Returns the updated dropped asset or an error.

      await droppedAsset.flip(.5);
      
    • Adds an array of links to an asset. Maximum is 20 links.

      Parameters

      Returns Promise<void | ResponseType>

      Returns the updated dropped asset or an error.

      await droppedAsset.setClickableLinkMulti({
      clickableLinks: [
      {
      clickableLink: "https://example_one.com",
      clickableLinkTitle: "Example One Link",
      isForceLinkInIframe: true,
      isOpenLinkInDrawer: false,
      },
      {
      clickableLink: "https://example two.com",
      clickableLinkTitle: "Example Two Link",
      isForceLinkInIframe: false,
      isOpenLinkInDrawer: false,
      },
      ],
      });
    • Set the interactive settings on a dropped asset

      Parameters

      • __namedParameters: { interactivePublicKey: string; isInteractive?: boolean }

      Returns Promise<void | ResponseType>

      await droppedAsset.setInteractiveSettings({
      isInteractive: true,
      interactivePublicKey: "xyz"
      });
    • 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;
    • Updates multiple clickable links for a dropped asset.

      Parameters

      Returns Promise<void | ResponseType>

      Returns the updated dropped asset or an error.

      Pass in an 'existingLinkId' to edit an existing link.

      await droppedAsset.updateClickableLinkMulti({
      clickableLink: "https://example.com",
      clickableLinkTitle: "Example Link",
      isForceLinkInIframe: true,
      isOpenLinkInDrawer: false,
      existingLinkId: "abcd"
      });
    • Updates click options for a dropped asset.

      Parameters

      Returns Promise<void | ResponseType>

      Returns the updated dropped asset or an error.

      await droppedAsset.updateClickType({
      "clickType": "portal",
      "clickableLink": "https://topia.io",
      "clickableLinkTitle": "My awesome link!",
      "clickableDisplayTextDescription": "Description",
      "clickableDisplayTextHeadline": "Title",
      "position": {
      "x": 0,
      "y": 0
      },
      "portalName": "community"
      });
    • Updates text and style of a dropped asset.

      Parameters

      • style: undefined | null | object
      • text: undefined | null | string

      Returns Promise<void | ResponseType>

      Returns the updated dropped asset or an error.

      const style = {
      "textColor": "#abc123",
      "textFontFamily": "Arial",
      "textSize": 40,
      "textWeight": "normal",
      "textWidth": 200
      };
      await droppedAsset.updateCustomTextAsset(style, "hello world");
    • Updates dropped asset details and assigns the response data to the instance. Requires Public Key to have the canUpdateDroppedAssets permission.

      Parameters

      Returns Promise<void | ResponseType>

      const payload = {
      assetScale: 1,
      clickType: "link",
      clickableDisplayTextDescription: "Description",
      clickableDisplayTextHeadline: "Headline",
      clickableLink: "https://topia.io",
      clickableLinkTitle: "Topia",
      flipped: false,
      isTextTopLayer: false,
      layer0: "https://www.shutterstock.com/image-vector/colorful-illustration-test-word-260nw-1438324490.jpg",
      layer1: "https://www.shutterstock.com/image-vector/colorful-illustration-test-word-260nw-1438324490.jpg",
      position: { x: 0, y: 0 },
      specialType: "webImage",
      text: "My Asset",
      textColor: "#000000",
      textSize: 20,
      textWeight: "normal",
      textWidth: 200,
      uniqueName: "example",
      yOrderAdjust: 0,
      }
      await droppedAsset.updateDroppedAsset();
      const { assetName } = droppedAsset;
    • Updates landmark zone options for a dropped asset.

      Parameters

      • __namedParameters: {
            isLandmarkZoneEnabled: boolean;
            landmarkZoneIsVisible?: boolean;
            landmarkZoneName?: string;
        }

      Returns Promise<void | ResponseType>

      Returns the updated dropped asset or an error.

      await droppedAsset.updateLandmarkZone({
      isLandmarkZoneEnabled: true,
      landmarkZoneName: "Example",
      landmarkZoneIsVisible: true,
      });
    • Updates media options for a dropped asset.

      Parameters

      Returns Promise<void | ResponseType>

      Returns the updated dropped asset or an error.

      await droppedAsset.updateMediaType({
      "mediaType": "link",
      "mediaLink": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
      "isVideo": true,
      "syncUserMedia": true,
      "audioSliderVolume: 30"
      "portalName": "community",
      "audioRadius": 0,
      "mediaName": "string"
      });
    • Updates mute zone options for a dropped asset.

      Parameters

      • isMutezone: boolean

      Returns Promise<void | ResponseType>

      Returns the updated dropped asset or an error.

      await droppedAsset.updateMuteZone(true);
      
    • Moves a dropped asset to specified coordinates.

      Parameters

      • x: number
      • y: number
      • OptionalyOrderAdjust: number

      Returns Promise<void | ResponseType>

      Returns the updated dropped asset or an error.

      await droppedAsset.updatePosition(100, 200, 100);
      
    • Updates the size of a dropped asset.

      Parameters

      • assetScale: number

      Returns Promise<void | ResponseType>

      Returns the updated dropped asset or an error.

      await droppedAsset.assetScale(.5);
      
    • Change or remove media embedded in a dropped asset.

      Parameters

      • mediaId: string

      Returns Promise<void | ResponseType>

      Returns the updated dropped asset or an error.

      await droppedAsset.updateUploadedMediaSelected("LVWyxwNxI96eLjnXWwYO");
      
    • Updates webhook zone options for a dropped asset.

      Parameters

      • isWebhookZoneEnabled: boolean

      Returns Promise<void | ResponseType>

      Returns the updated dropped asset or an error.

      await droppedAsset.updateWebhookZone(true);
      
    • Change or remove top and bottom layers of a dropped asset.

      Parameters

      • bottom: string
      • top: string

      Returns Promise<void | ResponseType>

      Returns the updated dropped asset or an error.

      await droppedAsset.updateWebImageLayers("","https://www.shutterstock.com/image-vector/colorful-illustration-test-word-260nw-1438324490.jpg");