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
@shopify/hydrogen의 ClientOnly로 비슷한 방식을 사용하세요. SSR 불일치를 피하려면 스크립트를 말단(leaf) 컴포넌트에 두세요.
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.


