This is a robust and easy-to-integrate JavaScript widget for Shutterstock.
npm install shutterstock-widget
import ShutterstockWidget from "@ShutterstockWidget"
Example on window load:
const searchPage = {
name: 'searchPage',
component: ShutterstockWidget.components.SearchPage,
props: {
mediaType: 'images',
title: 'Shutterstock UI Search Widget',
subtitle: '',
dynamicTitle: true,
dynamicSubtitle: true,
showMore: true,
showSearchBar: true,
onItemClick: (e, item) => {
e.preventDefault();
console.log(item);
}
}
};
const widget = new ShutterstockWidget({
container: document.getElementById('widget-container'),
key: 'YOURKEY',
pages: [searchPage]
});
widget.getPage('searchPage').search()