> For the complete documentation index, see [llms.txt](https://docs.bogos.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bogos.io/cn/advanced-customization/works-with-headless-hydrogen.md).

# 配合 Headless/Hydrogen 使用

### 概览

BOGOS 为 Headless 店铺提供两种集成方式，分别适用于不同的使用场景和技术需求。本指南将详细说明这两种方式，帮助您选择最适合自己配置的方案：

[方式 1：API 集成（最大灵活性）](#option-1-api-integration-maximum-flexibility)

[方式 2：JS/SDK 集成（更快实现）](#option-2-js-sdk-integration-faster-implementation)

### 方式 1：API 集成（最大灵活性）

**文档：**<https://bogos-api-integration.gitbook.io/bogos-api-integration/integration-steps/gift-offer>

\*\*适合对象：\*\*需要完全掌控权、并为任意平台（网页、移动应用或第三方集成）进行开发的开发者

**支持的优惠活动类型**

API 集成支持**所有 BOGOS 优惠活动类型**，包括赠品优惠、捆绑优惠、追加销售优惠、折扣优惠及助推器。该方式让您可以通过 API 端点直接访问 BOGOS 的核心功能。

**优势**

* **完全自定义** —— 精确构建您所需要的内容
* **平台无关** —— 适用于网页应用、移动应用及第三方集成
* **完全掌控** —— 按照您想要的方式实现具体逻辑

**技术要求**

您的开发团队需要在以下方面具备扎实的专业能力：

* Shopify 平台架构
* Storefront API 实现
* BOGOS 应用功能及优惠活动运作机制

这并非一种即插即用的解决方案。您需要从零开始构建集成，这意味着您的开发人员既要理解 Shopify 生态系统，也要了解 BOGOS 促销活动底层的运作原理。

***

### 方式 2：JS/SDK 集成（更快实现）

**文档：**<https://bogos-api-integration.gitbook.io/bogos-api-integration/bogos-js-sdk>

\*\*适合对象：\*\*注重实现速度、并希望获得可运行代码示例的网页应用

**支持的优惠活动类型**

JS/SDK 支持所有 BOGOS 优惠活动类型，让您以更少的开发工作量全面覆盖 BOGOS 的各项功能。

**优势**

* **开发速度更快** —— 预构建的 SDK 承担了大部分工作
* **具体示例** —— 演示代码帮助您快速上手
* **无需深入了解细节** —— 仍需具备 Shopify 及 Storefront API 相关能力，但无需了解 BOGOS 内部实现的每个细节

**局限性**

* **仅限网页应用** —— 不兼容原生移动应用

***

### 开始使用

\*\*第 1 步：\*\*梳理您的技术需求

* 您需要支持哪些平台？
* 您在 BFCM 期间将运行哪些类型的优惠活动？
* 您的开发时间表是怎样的？

\*\*第 2 步：\*\*评估团队的专业能力

* 团队对 Shopify 架构的熟悉程度如何？
* 团队是否有足够的资源从零构建（API 方式），还是需要更快的实现方式（SDK 方式）？

\*\*第 3 步：\*\*选择您的集成方式

* \*\*API 方式：\*\*参考您所选优惠类型对应的 API 集成指南开始操作。
* \*\*SDK 方式：\*\*查阅 JS/SDK 文档及演示代码。

\*\*第 4 步：\*\*查阅文档，并向 BOGOS 支持团队申请您的 **bogos api-key**

\*\*第 5 步：\*\*根据您所选方式的说明进行构建。


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.bogos.io/cn/advanced-customization/works-with-headless-hydrogen.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
