本文へスキップ
新機能商品Q&A: お客様が商品ページで質問し、あなたの回答を受け取れます。仕組みを見る
IdukkiIdukki
Developers + API

Hydrogen、Next.js、Astro、Remixへの埋め込み

ヘッドレスストアフロントで、SSRやハイドレーションを妨げずにウィジェットを組み込むための、フレームワーク別の方法です。

5 min read · last updated 2026-05
On this page

ヘッドレスストアフロントでも、ウィジェットは同じ1本のスクリプトです。ただし、SSRやハイドレーションと衝突しないように、設置する場所に注意が必要です。基本の方法は共通です。プレースホルダーを描画し、スクリプトを遅延読み込みし、末端のコンポーネントに置きます。

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、Astro、Remix

考え方は同じです。プレースホルダーのdivとスクリプトを末端のコンポーネントに置き、ハイドレーションの後でスクリプトを読み込みます。Hydrogenでは、クライアント専用のラッパーを使うとSSRの不一致を避けられます。Astroでは、アイランドにクライアントディレクティブを付けると同じ効果があります。Remixでは、クライアントでのみ動くコンポーネントに設置します。

Was this page helpful?

Still stuck?

Email us at support@idukki.io or open the in-app chat. We answer within one working day.

Talk to a human

Related guides

Live in minutesDTC + B2B brands79 KB runtimeReal G2 reviews

Stuck?

A real human is faster than a search box.

In-app chat is staffed during EU + US business hours. Status of a ticket? Email support@idukki.io and we’ll surface it.

  • No credit card
  • Cancel anytime
  • GDPR self-certified · SOC 2 (in audit)