Switch an Item's Primary Image

Use this method to update an item's primary image.

Usage in your script

const updatedItem = await alturaItem.updatePrimaryImage(IMAGE_INDEX);

Remember, imageIndex starts at 0 and not 1. Therefore the highest imageIndex is imageCount - 1

Parameters

Parameter
Type
Required
Description

imageIndex

Integer

Yes

The index of the image you wish to change to

Last updated