> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/embedding.md).

# 製品に埋め込む

Docs Embed を使って、ドキュメントを製品や Web サイトに埋め込みます。

Docs Embed は、あらゆる製品やウェブサイトに追加できる、製品に関するナレッジへの強力な窓口です。ユーザーは、製品を離れることなく、次の相手に質問したり、 [GitBook Assistant](https://gitbook.com/docs/documentation/ja-gitbook-documentation/ai-for-your-readers/gitbook-ai-assistant.md)に質問したり、ドキュメントを検索したり、ページを直接閲覧したりできます。ボタンで Embed を開いたり、任意のコンポーネントに配置したり、完全にプログラムから制御したりできます。

<div data-with-frame="true"><figure><img src="https://4217681718-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-47120dd47f43cd781d9f5da4f34c80039fd765fa%2F25_10_21_emebeddable_assistant.png?alt=media" alt="Embed GitBook Assistant into your product or website"><figcaption><p>ドキュメントを製品やウェブサイトに埋め込みましょう</p></figcaption></figure></div>

## 概要

Docs Embed には 3 つのタブを含めることができます:

* **アシスタント**： [GitBookアシスタント](https://gitbook.com/docs/documentation/ja-gitbook-documentation/ai-for-your-readers/gitbook-ai-assistant.md) — ユーザーが答えを見つけるのを支援する、AI搭載のチャットインターフェース
* **Search**：ページをすばやく見つけ、対象を絞った質問をするための検索中心の画面
* **Docs**：ドキュメントサイトを閲覧するためのブラウザー

デフォルトでは、すべてのタブが有効になっています。 `tabs`を設定すると、Embed には指定したタブのみが表示されます。

カスタムアクション、ツール、質問候補、 [認証付きアクセス](https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/site-audience/authenticated-access.md)などを使って、デフォルト設定をカスタマイズまたは上書きできます。

## 始める

{% stepper %}
{% step %}
**前提条件**

ドキュメントを埋め込む前に、次を確認してください:

1. **ドキュメントが公開されており、** URL（例： `https://docs.company.com`).
2. **サイト設定から Embed スクリプトの URL を取得済みであること** （Settings → AI & MCP → Embed）。

{% hint style="info" %}
Assistant タブを使用する場合は、 [ドキュメントサイトで GitBook Assistant を有効にする必要があります](https://gitbook.com/docs/documentation/ja-gitbook-documentation/ai-for-your-readers/gitbook-ai-assistant.md) （Settings → AI & MCP）。
{% endhint %}
{% endstep %}

{% step %}
**実装**

既存のスタックを使って、GitBook Assistant を製品に素早く実装するために、私たちのスキルを活用してください。

{% file src="/files/e598c82cf1e0ddfb459a241b4284058a74c255f5" %}

別の方法として、セットアップに合ったアプローチについて引き続きドキュメントをお読みください:

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><i class="fa-code">:code:</i></td><td><strong>単独の script タグ</strong></td><td>最速のセットアップには &#x3C;script> タグを追加し、その後外観をカスタマイズします</td><td><a href="https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/embedding/implementation/script.md">script タグ</a></td></tr><tr><td><i class="fa-box">:box:</i></td><td><strong>Node.js/NPM</strong></td><td>サーバーサイドレンダリングやビルド時の制御のために、NPM 経由でインストールします</td><td><a href="https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/embedding/implementation/nodejs.md">Node.js/NPM</a></td></tr><tr><td><i class="fa-react">:react:</i></td><td><strong>React コンポーネント</strong></td><td>シームレスな統合のために、あらかじめ用意された React コンポーネントを使用します</td><td><a href="https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/embedding/implementation/react.md">React</a></td></tr></tbody></table>

{% hint style="info" %}
ドキュメントで [認証付きアクセス](https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/site-audience/authenticated-access.md)を使用している場合は、 [認証が必要なドキュメントで Embed を設定する方法](https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/embedding/using-with-authenticated-docs.md).
{% endhint %}
{% endstep %}

{% step %}
**設定**

* [Embed のカスタマイズ](https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/embedding/configuration/customizing-docs-embed.md) – ウェルカムメッセージ、カスタムアクション、候補を追加
* [カスタムツールの作成](https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/embedding/configuration/creating-custom-tools.md) – Assistant を製品の API に接続
  {% endstep %}
  {% endstepper %}

## 参考情報

API リファレンスとソースコードの詳細については、GitHub の [`@gitbook/embed` パッケージを参照してください](https://github.com/GitbookIO/gitbook/tree/main/packages/embed).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://gitbook.com/docs/documentation/ja-gitbook-documentation/publish/embedding.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
