I’m having trouble with
using createGalleryItem with a ApiKeyStrategy setup.
Working in
VSCode
Site link
https://www.ozarkgranite.com/live-inventory
What I’m trying to do
Im trying to get a function to create a item on a gallery in the live inventory pro gallery.
What I’ve tried so far
-
reading api docs
-
Looking for similar cases
-
asking claude
-
changing the json package to every form and as simple as possible to only a title
-
clearing cache
-
reseting with a new progallery
Extra context
const newImageItem = {
title: "TEST TITLE",
imageInfo: {
// Replace with your actual Wix media URL
src: myImageUrl,
alt: "TEST",
},
type: "WIX_MEDIA",
}
async function addGalleryItem(galleryId, itemInfo) {
try {
const createdItem = await myWixClient.proGallery.createGalleryItem(
galleryId,
itemInfo
);
console.log("Gallery item created successfully:", createdItem);
return createdItem;
} catch (error) {
console.error("Error creating gallery item:", error);
}
}
What this function returns.
Gallery item created successfully: {
sortOrder: 1761940976507,
title: 'My New Gallery Image',
type: 'UNDEFINED',
_id: ########,(I REMOVED THIS BUT IT IS A LEGITIMATE ID)
_createdDate: 2025-10-31T20:02:56.507Z,
_updatedDate: 2025-10-31T20:02:56.507Z
}
What the site looks like if gallery is not broken.
