> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/zh-cn/pei-zhi/overleaf-toolkit/zotero-integration.md).

# Zotero 集成

{% hint style="info" %}
此功能最初由 [davrot](https://github.com/davrot) 和 [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep)，由 [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro) 使用 OAuth。它从 v6.2.0 及更高版本引入。目前仍处于 Beta 状态。如果您遇到任何问题，我们需要您的反馈。
{% endhint %}

<div data-with-frame="true"><figure><img src="/files/dd82f18e56180708294a201bdf9b352d80e7471f" alt=""><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="/files/ecd06eb1c3c128ee2562923b06674c58ce3b21d5" alt=""><figcaption></figcaption></figure></div>

### 设置 Zotero 集成

1. 打开 [此链接](https://www.zotero.org/oauth/apps) 以创建 Zotero OAuth 客户端（如图所示）
2. 选择 **应用类型**: **浏览器**
3. 设置回调 URL，使用您的 `${OVERLEAF_SITE_URL}/user/zotero/oauth/callback`
4. 配置您的 `config/variables.env`

<figure><img src="/files/8ef24c3f60910175fcdbaf05f1dc99c88ba3fd3b" alt="" width="375"><figcaption></figcaption></figure>

{% code title="config/variables.env" %}

```dotenv
#################
#    Zotero     #
#################
# 'zotero' 必须包含在 ENABLED_LINKED_FILE_TYPES 中（在 develop/docker-compose.yml 中设置）
ENABLED_LINKED_FILE_TYPES=project_file,project_output_file,url,zotero

# 来自 Zotero OAuth 客户端（在 https://www.zotero.org/oauth/apps 注册）
# 应用类型：浏览器 
# 回调 URL -> ${OVERLEAF_SITE_URL}/user/zotero/oauth/callback
ZOTERO_CLIENT_ID=
ZOTERO_CLIENT_SECRET=
# 将 Zotero API 密钥加密后存储在 mongo 中（在开发环境中设置，以避免写入密钥文件
# 到 /var/lib/overleaf/data，开发版 web 容器无法创建该目录）
# 如何生成：`openssl rand -hex 32`
ZOTERO_CIPHER_PASSWORD=dev-zotero-cipher-password
# 可选：将该模块的服务器端 Zotero 请求（OAuth + API）通过
# 一个 HTTP 代理转发（必须可从 web 容器访问；与 github-sync 相同）
# http://10.0.0.1:10808
# （可选）ZOTERO_PROXY_URL=
```

{% endcode %}


---

# 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://ayakaleaf-pro.ayaka.space/on-premises/zh-cn/pei-zhi/overleaf-toolkit/zotero-integration.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.
