[AEM Assets]{class="badge positive" title="Applies to AEM Assets)."}
Content Advisor installation and properties content-advisor-installation-properties
Content Advisor is also available for integration with non-Adobe (third-party) applications, extending intelligent asset discovery beyond Adobe applications. The same rich feature set, including AI-powered search, context-aware recommendations, campaign brief–based discovery, access to Dynamic Media renditions, Content Fragment discovery, filters, and asset metadata, is supported in third-party integrations.
Prerequisites prereqs
You must ensure the following communication methods:
- The host application is running on HTTPS.
- You cannot run the application on
localhost. If you want to integrate Content Advisor on your local machine, you need to create a custom domain for example[https://<your_campany>.localhost.com:<port_number>]and add this custom domain in theredirectUrl list. - You can configure and add clientID into the AEM Cloud Service environment variable with the respective
imsClientId. - The list of IMS scopes needs to be defined in the environment configuration.
- The URL of the application is in the IMS client’s allowed list of redirect URLs.
- The IMS login flow is configured and rendered using a popup on the web browser. Therefore, popups should be enabled or allowed on the target browser.
Use the above prerequisites if you require the IMS authentication workflow of Content Advisor. Alternatively, if you are already authenticated with the IMS workflow, you can add the IMS information instead.
- Domain names where the integrating application is hosted.
- After provisioning, your organization will be provided with
imsClientId,imsScope, and aredirectUrlcorresponding to the environments requested that are essential for the configuration of Content Advisor. Without those valid properties, you cannot run the installation steps.
Installation content-advisor-installation
Content Advisor is available via both ESM CDN (For example, esm.sh/skypack) and UMD version.
In browsers using UMD version (recommended):
<script src="https://experience.adobe.com/solutions/CQ-assets-selectors/static-assets/resources/assets-selectors.js"></script>
<script>
const { renderAssetSelector } = PureJSSelectors;
</script>
In browsers with import maps support using ESM CDN version:
<script type="module">
import { AssetSelector } from 'https://experience.adobe.com/solutions/CQ-assets-selectors/static-assets/resources/@assets/selectors/index.js'
</script>
In Deno/Webpack Module Federation using ESM CDN version:
import { AssetSelector } from 'https://experience.adobe.com/solutions/CQ-assets-selectors/static-assets/resources/@assets/selectors/index.js'
Content Advisor properties content-advisor-propertiess
You can use the Content Advisor properties to customize the way the Content Advisor is rendered. The following table lists the properties that you can use to customize and use Content Advisor.
true, Content Advisor is rendered in a left rail view. If it is marked false, the Content Advisor is rendered in modal view.imsOrg key is required to authenticate whether the organization you are accessing is under Adobe IMS or not.imsToken is required if you are using an Adobe application for the integration.apiKey is required if you are using an Adobe application integration.<Object>[{id: 'urn:234}, {id: 'urn:555'}] An asset must be available in the current directory. If you need to use a different directory, provide a value for the path property as well.rail property to enable rail view of assets viewer.Object<{ id?: string, defaultMessage?: string, description?: string}>i18nSymbols prop. Passing a value through this interface overrides the default translations provided and instead use your own. To perform the override, you must pass a valid Message Descriptor object to the key of i18nSymbols that you want to override.intl.locale prop. For example: intl={{ locale: "es-es" }}The locale strings supported follow the ISO 639 - Codes for the representation of names of languages standards.
List of supported locales: English - ‘en-us’ (default) Spanish - ‘es-es’ German - ‘de-de’ French - ‘fr-fr’ Italian - ‘it-it’ Japanese - ‘ja-jp’ Korean - ‘ko-kr’ Portuguese - ‘pt-br’ Chinese (Traditional) - ‘zh-cn’ Chinese (Taiwan) - ‘zh-tw’
Array<string>{allowList?: Object}default and express. It also supports @react-spectrum/theme-express.Invoked with array of Asset items when assets are selected and the Select button on the modal is clicked. This function is only invoked in modal view. For rail view, use the handleAssetSelection or onDrop functions. Example:
handleSelection=(assets: Asset[])=> {…}
See selection of assets for details.
Invoked with array of items as the assets are being selected or unselected. This is useful when you want to listen for assets as user selects them. Example:
handleAssetSelection=(assets: Asset[])=> {…}
See selection of assets for details.
Close button in modal view is pressed. This is only called in modal view and disregarded in rail view.single or multiple selection of assets at a time.Syntax:
aemTierType: "author" "delivery"For example, if both
["author","delivery"] are used, then the repository switcher displays options for both author and delivery.EXPIRED, EXPIRING_SOON or NOT_EXPIRED based on the expiry date of an asset that you provide. See customize expired assets. Additionally, you can use allowSelectionAndDrag in which the value of the function can either be true or false. When the value is set to false, the expired asset cannot be selected or dragged on the canvas.uploadConfig property. Add an array of fields that you provide to gather metadata from the user. Using this property, you can also use hidden metadata which is assigned to an asset automatically but is not visible to the user.uploadConfig property. It consists of property and value. Property equals the mapToProperty of the field passed from the metadataSchema whose value is being updated. Whereas,value equals the new value is provided as an input."/content/dam"uploadConfig property. The target upload path for the files which defaults to root of the assets repository.uploadConfig property.(uploadInfo: UploadInfo) => void. This property is nested under uploadConfig property.sourceTypes uses an array of the import sources that you want to enable. The supported sources are Onedrive and Dropbox. The syntax is { sourceTypes?: ImportSourceType[]; apiKey?: string; }. Moreover, this property is nested under uploadConfig property.(uploadStats: UploadStats) => void. Moreover, this property is nested under uploadConfig property.uploadConfig property. It is a callback function which is used to show the behavior of upload when a file is changed. It passes the new array of files pending for upload and the source type of the upload. Source type can be null in case of error. The syntax is (newFiles: File[], uploadType: UploadType) => void{ href: string; alt: string; }, Moreover, this property is nested under uploadConfig property.featureSet:[ ] property is used to enable or disable a particular functionaly in the Content Advisor application. To enable the component or a feature, you can pass a string value in the array or leave the array empty to disable added features, and just have the base functionality. For example, you want to enable upload functionality in the Content Advisor, use the syntax featureSet:["upload"]. Similarly, you can use featureSet:["content-fragments"] to enable Content Fragments in the Content Advisor. To use multiple features together, the syntax is featureSet:[“upload”, “content-fragments”].ImsAuthProps ims-auth-props
The ImsAuthProps properties define the authentication information and flow that the Content Advisor uses to obtain an imsToken. By setting these properties, you can control how the authentication flow should behave and register listeners for various authentication events.
imsClientIdimsScoperedirectUrlredirectUrl is not supplied, ImsAuthService uses the redirectUrl used to register the imsClientIdmodalModetrue, the authentication flow is displayed in a pop-up. If set to false, the authentication flow is displayed in a full page reload. Note: for better UX, you can dynamically control this value if the user has browser pop-up disabled.onImsServiceInitializedservice, which is an object representing the Adobe IMS service. See ImsAuthService for more details.onAccessTokenReceivedimsToken is received from the Adobe IMS authentication service. This function takes one parameter, imsToken, which is a string representing the access token.onAccessTokenExpiredonErrorReceivedImsAuthService ims-auth-service
ImsAuthService class handles the authentication flow for the Content Advisor. It is responsible for obtaining an imsToken from the Adobe IMS authentication service. The imsToken is used to authenticate the user and authorize access to the Adobe Experience Manager as a Cloud Service Assets repository. ImsAuthService uses the ImsAuthProps properties to control the authentication flow and register listeners for various authentication events. You can use the convenient registerAssetsSelectorsAuthService function to register the ImsAuthService instance with the Content Advisor. The following functions are available on the ImsAuthService class. However, if you are using the registerAssetsSelectorsAuthService function, you do not need to call these functions directly.
isSignedInUsergetImsTokenimsToken for the currently signed-in user, which can be used to authenticate requests to other services such as generating asset _rendition.signInImsAuthProps to show authentication in either a pop-up or a full page reloadsignOutrefreshTokencontentFragmentSelectorProps content-fragment-selector-properties
contentFragmentSelectorProps allows you to configure how Content Fragments are accessed and displayed within the Content Advisor. By enabling the content-fragments feature in the featureSet and providing the required configuration, you can seamlessly integrate Content Fragment selection alongside assets. This enables users to browse, search, and select Content Fragments within the same unified interface, ensuring a consistent content selection experience across assets and structured content.
const assetSelectorProps = {
featureSet: [
'upload', /* Include upload or other featureSet values to ensure no missing functionality */
'content-fragments', /* Content Fragments pill will be shown */
],
contentFragmentSelectorProps: {
/* Configures the Content Fragments Pill experience */
/* ...props @aem-sites/content-fragment-selector MFE supports */
}
}
<AssetSelector {...assetSelectorProps} />
In contentFragmentSelectorProps, you can mention any of the properties available at Content Fragment Selector properties.
For information on how to integrate Content Advisor with Angular, React, and JavaScript applications, refer to Content Advisor integration examples.