@guava-ai/guava-sdk

中文文档
0.44.0发布于 2026/11/11TypeScriptCommonJS近 30 天下载 5206

The official TypeScript SDK for building Guava voice agents.

原始使用文档
文档目录5 节
  1. Documentation
  2. Authentication
  3. Try an Example
  4. Installation
  5. Using WebRTC from the Browser

Guava Typescript SDK

NPM Version

This library allows you to build Guava voice agents using TypeScript or Javascript. Currently only NodeJS is officially supported as a runtime for the main SDK. The WebRTC portion of the SDK can be used from the browser.

Documentation

Full documentation for the TypeScript SDK can be found at https://goguava.ai/docs/. SDK examples can be found under ./examples/.

Authentication

Log in using the Guava CLI:

guava login

Alternatively, provide an API key through an environment variable.

$ export GUAVA_API_KEY="..." # Your API key for authentication.
$ export GUAVA_AGENT_NUMBER="..." # A phone number for your agent to use.

Try an Example

Run an outbound phone call example using npx. Replace the phone number with your own and your agent will call you.

$ npx @guava-ai/guava-sdk@latest scheduling-outbound phone +15556667777 # Your agent will call this number.

Installation

Install the SDK using your preferred package manager.

$ npm install @guava-ai/guava-sdk
$ yarn add @guava-ai/guava-sdk
$ pnpm add @guava-ai/guava-sdk

The SDK can be used with Javascript, but TypeScript is highly recommended.

Using WebRTC from the Browser

To call your agent from the browser with a bundler, install the SDK as above and import from @guava-ai/guava-sdk/webrtc.

import * as Guava from "@guava-ai/guava-sdk/webrtc";

const call = new Guava.Call({ webrtcCode: "..." });
await call.start();

You can also load a prebuilt bundle from a CDN.

<script
  src="https://cdn.jsdelivr.net/npm/@guava-ai/[email protected]/dist/guava-webrtc.min.js"
  integrity="sha384-CqOmyWgWQBezum+sb7uPDUvYIN4/0eKmWbgs/LEjsn+KmW8PoP9zwB1FVQR7v3c3"
  crossorigin="anonymous"
></script>
<script>
  const call = new Guava.Call({ webrtcCode: "..." });
  call.start();
</script>

Or as an ES module:

<script type="importmap">
  {
    "integrity": {
      "https://cdn.jsdelivr.net/npm/@guava-ai/[email protected]/dist/guava-webrtc.esm.min.js": "sha384-Lf/SBkHjXX4aPSR9S2XcqQXaI21CnugMUu7ROfHLJGnvtPMS0lFNuYTnUal6eAZ8"
    }
  }
</script>
<script type="module">
  import * as Guava from "https://cdn.jsdelivr.net/npm/@guava-ai/[email protected]/dist/guava-webrtc.esm.min.js";
  const call = new Guava.Call({ webrtcCode: "..." });
  await call.start();
</script>

See the WebRTC calling guide for more details on how to create WebRTC agents with Guava.

版本与发布记录

@guava-ai/guava-sdk 共发布 48 个版本,首次发布于 2026/01/18;过去 12 个月发布了 48 个版本。

版本发布日期距今
0.44.0latest2026/11/116 天前
0.43.02026/11/0413 天前
0.42.02026/10/2919 天前
0.41.02026/10/2127 天前
0.40.02026/10/161 个月前
0.39.02026/10/141 个月前

关于 @guava-ai/guava-sdk 的常见问题

@guava-ai/guava-sdk 是什么?

The official TypeScript SDK for building Guava voice agents.

如何安装 @guava-ai/guava-sdk?

在项目目录运行 npm install @guava-ai/guava-sdk,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 guava-example,可以用 npx guava-example 直接运行。

@guava-ai/guava-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@guava-ai/guava-sdk 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@guava-ai/guava-sdk 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@guava-ai/guava-sdk 可以商用吗?

@guava-ai/guava-sdk 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@guava-ai/guava-sdk 的下载量有多少?

根据 npm 官方下载统计,@guava-ai/guava-sdk 在 2026/10/17 – 2026/11/15 这 30 天内被下载 5,206 次,日均约 174 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@guava-ai/guava-sdk 还在维护吗?

最新版本 0.44.0 发布于 2026/11/11(6 天前);至今共发布 48 个版本,其中过去 12 个月发布了 48 个;首次发布于 2026/01/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。