getSvcImage(key)
Calls the Constellation Service to fetch an image. This call is authenticated by the Constellation Service, using the issued B2S JWT token.
Returns
A Promise that resolves to the image (blob) specified as the key.
Parameters
Name | Type | Description | Required |
key | string | The unique identifier of the image. | ✅ |
Usage example
In this example, the API returns a Promise that resolves to the image (blob) specified as the key.
const operatorImg = await AssetLoader
.getSvcImage('DATA-CONTENT-IMAGE [email protected]!PNG!/OPERATORIMAGES/')
.then((data) => {
const url = window.URL.createObjectURL(data);
return url;
})
.catch(() => {
console.error('Unable to load the image!');
});
Previous topic getSvcComponentsConfig(criteriaToMatch, options) Next topic getSvcLocale(locale, key)