Skill Level: Beginner
You can now use the Watson Content Hub Palette in delivery mode. By using the Palette in delivery mode, you can now select content and assets without authentication. The palette in the delivery mode returns only the published assets and content. This tutorial shows you how to launch the Watson Content Hub Palette in delivery mode in your application.
You must have a Watson Content Hub tenant from which you wantÂ to select Content or Assets. If you do not already have a Watson Content Hub tenant, you can sign up for free here: https://www.ibm.com/uk-en/marketplace/cloud-cms-solution
Determine the API URL of your tenant
The client must specify the API URL when the Palette is launched. The tenant API URL is added as the apiUrl query parameter. For example:
Obtain the API URL from the â€˜Hub informationâ€™ dialog in the WCH UI:
- The Delivery Palette is only accessible through the Authoring hostÂ https://www.digitalexperience.ibm.com/content-picker/picker.html .
- Therefore, API requests are issued from the â€˜wwwâ€™ Authoring host, but are made to the â€˜myNâ€™ Delivery host. Requests to the â€˜myNâ€™ Delivery host from other domains are blocked by default and you encounter a CORS exception. CORS, or Cross-Origin Resource SharingÂ is a mechanism that allows restricted resources on a web page to be requested from another domain outside the domain from which the first resource was served.
- Therefore, it is necessary to add the â€˜wwwâ€™ Authoring host as a trusted domain for your tenant:
Access the Delivery Palette
Now that you know your API URL and enabled CORS for your tenant you can access the WCH Palette in delivery mode at the URL determined in step one:
You can add further query parameters to launch the Palette in other modes too. For example:
Â 1.Â Â Â Â Launch the Delivery Palette for Content Items only:
Â 2.Â Â Â Â Launch the Delivery Palette for Assets only:
Â 3.Â Â Â Â Launch the Delivery Palette for Image Assets only:
Â 4.Â Â Â Â Launch the Delivery Palette for Image Assets tagged with â€˜natureâ€™ only:
Accessing the WCH Palette sample page for your tenant
You can access the Delivery Palette through the Sample page: https://www.digitalexperience.ibm.com/content-picker/samples/pickerConsumer.html
Note: The sample page also includes Authoring launch modes that require you to be logged in to WCH and have the WCH cookies â€“ the delivery options are unauthenticated.
You can now access all of the Content and Assets from your Watson Content Hub tenant using the Watson Content Hub Palette.