The Idukki widget is a single self-contained <script>. It renders into a placeholder div and never touches your app’s state.
Next.js (App Router)
import Script from "next/script"
export function IdukkiGallery({ bguid, guid }: { bguid: string; guid: string }) {
return (
<>
<div data-ugc="idukki" data-bguid={bguid} data-guid={guid} data-retarget="false" />
<Script src="https://idukki-cdn.com/version/script_0" strategy="lazyOnload" />
</>
)
}Hydrogen
Utilisez un schéma similaire avec le ClientOnly de @shopify/hydrogen. Placez le script dans un composant feuille pour éviter tout décalage avec le SSR.
Galleries after a route change
The loader mounts the galleries on the first page. It then watches for 30 seconds. A gallery that renders later stays empty until you mount it.
- From a component: call Idukki.mount(el) when the gallery renders, and Idukki.unmount(el) when it leaves.
- Without code: add data-idk-spa="1" to the loader tag. The widget then mounts galleries after each route change.
Mounted galleries send their GA4, pixel and GTM events as on any store. The full walkthrough is /blog/track-ugc-galleries-headless-hydrogen-nextjs.


