This is how you setup contribe with upcart
<script type="module">
const upcart = document.getElementById("upCart");
if (upcart) {
const element = upcart?.shadowRoot ?? upcart;
const target = element?.querySelector(".upcart-products-section");
const shopId = window?.Shopify?.shop ??window?.__NEXT_DATA__?.props?.pageProps?.shop
if (target) {
const plugin = document.createElement("contribe-plugin");
plugin.setAttribute("pluginId", shopId);
target.appendChild(plugin);
const script = document.createElement("script");
script.src = "https://plugins.contribe.io/cdn/v1/plugin.mjs";
script.type = "module";
document.head.appendChild(script);
}
}
</script>