embed-sdk/applications-catalog
https://github.com/elfsight/embed-sdk#apps-catalog
by elfsight
HTML
<script src="https://elfsight.com/embed-sdk.js"></script>
<!-- add SDK -->
<script src="https://elfsight.com/embed-sdk.js"></script>
<main>
<!-- create the catalog container element in HTML -->
<div id="container"></div>
</main>
<script>
// get the container
const container = document.querySelector('#container');
// define the callback
const callback = (widget) => {
// process the data for the configured user widget
console.log(widget);
// in this example the widget is simply displayed on the page
document.body.appendChild(widget.element);
container.style.display = 'none';
};
// configure the catalog options if necessary
const options = {
height: 'auto'
};
// initialize the catalog
ElfsightEmbedSDK.displayCatalog(container, callback, options);
</script>
CSS
body {
margin: 0;
}
main {
max-width: 880px;
margin: 2em auto;
}