> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/web-plugins/convai-web-sdk-1.md).

# Convai Web SDK（旧版）

在你自己的 Web 应用中集成 Convai 对话服务

### 概述

{% hint style="info" %}
:no\_entry: 此插件已弃用，不再提供支持。

\
如果你仍在使用旧版插件，我们建议切换到新版 Convai Web SDK： [链接](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk)

\
仅供历史参考——这些文档已不再维护。
{% endhint %}

这个 <mark style="color:绿色;">convai-web-sdk</mark> 是一个功能强大的 npm 包，可帮助开发者轻松地将栩栩如生的角色集成到 Web 应用中。此 SDK 能够捕获用户的音频流，并以音频、动作和面部表情的形式提供相应反馈。无论你是在构建交互式网站、聊天机器人还是游戏，这个包都能为用户体验增添一份人情味。

### **开始之前**

登录 [Convai](https://convai.com/) 并复制你的 API 密钥。稍后你将使用它与虚拟形象进行对话。

### **安装软件包**

[Convai Web SDK](https://www.npmjs.com/package/convai-web-sdk?activeTab=readme) 以 npm 包的形式提供。在 React 项目的根目录中运行以下命令来安装该软件包。

`npm install convai-web-sdk@latest`

{% hint style="success" %}
LTS 版本：0.0.6
{% endhint %}

{% hint style="info" %}
开始集成之前，请确保你已在 Convai 创建账户，并拥有自己的 API 密钥。
{% endhint %}


---

# 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://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/web-plugins/convai-web-sdk-1.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.
