Preparing search index...

    A handle that provides access to the AssetLibraryListService.

        // IAssetLibraryProvider is the entry point for the online asset library.
    // Resolve via findInterface, then use one of its three services.
    // Below: list a few assets, then fetch them by id with assetsByIdsService.
    const provider = this.pluginSystem.findInterface(
    IAssetLibraryProvider.interfaceId
    ) as import('LensStudio:AssetLibrary').IAssetLibraryProvider;

    const envSetting = new EnvironmentSetting();
    envSetting.environment = Environment.Production;
    envSetting.space = Space.Public;

    // 1) Discover ids via assetService
    const listFilter = new AssetFilter();
    listFilter.searchText = 'material';
    const listResp = await provider.assetService.fetchAsync(
    new AssetListRequest(envSetting, listFilter)
    );
    const ids = listResp.ok && listResp.data
    ? listResp.data.assets.slice(0, 3).map(a => a.assetId)
    : [];

    // 2) Resolve full asset records by id with assetsByIdsService
    const idResp = await provider.assetsByIdsService.fetchAsync(
    new GetAssetsByIdsRequest(envSetting, ids)
    );
    if (idResp.ok && idResp.data) {
    console.log(`Fetched ${ids.length} assets by id`);
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    assetsByIdsService: GetAssetsByIdsService

    Service for fetching assets by their IDs.

    assetService: AssetListService

    Service for listing assets from the asset library.

    interfaceId: InterfaceId

    Unique identifier for the IAssetLibraryProvider plugin component interface.

    musicService: MusicListService

    Service for listing music assets from the asset library.

    Methods

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean