@frigade/assist-api

中文文档
1.4.0发布于 2026/11/03SEE LICENSE IN LICENSETypeScriptES Module近 30 天下载 2901

Frigade Assist API - Add product answers and live guidance to your agent

原始使用文档
文档目录5 节
  1. Install
  2. Usage
  3. Events
  4. Options
  5. License

@frigade/assist-api

Frigade Assist API: add product answers and live, on-page guidance to your own AI agent.

Install

npm install @frigade/assist-api

Requires react and react-dom 18-19 as peer dependencies.

Usage

import * as FrigadeAssistAPI from '@frigade/assist-api';

FrigadeAssistAPI.init({
  apiKey: 'YOUR_FRIGADE_PUBLIC_API_KEY',
  apiUrl: 'https://api.frigade.ai',
  userId: 'user-123',
});

Call it once, in the browser, after your app loads. Then launch a guide from your agent:

const result = await FrigadeAssistAPI.query({
  intent: 'Invite a teammate',
});

Or pass a Vercel AI SDK tool call straight through (returns null if the tool call isn't Frigade's):

const result = await FrigadeAssistAPI.handleToolCall(toolCall);

result.status is one of started, answer, needs_clarification, cancelled, unavailable, or error. Calls made before init resolve unavailable with reason not-initialized; calls made while init is still loading wait for it.

Dismiss the running guide:

FrigadeAssistAPI.close();

A query() still in flight resolves cancelled, as it does when the user closes the guide card. Before init, or with no guide running, close() does nothing.

Events

const unsubscribe = FrigadeAssistAPI.on('complete', () => {
  console.log('Guide completed');
});

unsubscribe();

Handlers can be registered before or after init. off(event, handler) also removes a handler. See the EventType type for all events.

Options

OptionTypeDescription
apiKeystringRequired. Your Frigade public API key.
apiUrlstringRequired. Frigade API URL.
userIdstringID of the signed-in user.
userPropertiesRecord<string, unknown>Extra properties about the user.
assistantIdstringScope requests to a specific assistant.
localestringForce the UI language (e.g. 'es-MX'). Defaults to browser.

See the FrigadeAssistAPIConfig type for the full list.

License

See LICENSE.

版本与发布记录

@frigade/assist-api 共发布 6 个版本,首次发布于 2026/09/29;过去 12 个月发布了 6 个版本。

版本发布日期距今
1.4.0latest2026/11/0313 天前
1.3.02026/10/151 个月前
1.2.02026/10/061 个月前
1.1.02026/09/301 个月前
1.0.12026/09/291 个月前
1.0.02026/09/291 个月前

关于 @frigade/assist-api 的常见问题

@frigade/assist-api 是什么?

Frigade Assist API - Add product answers and live guidance to your agent

如何安装 @frigade/assist-api?

在项目目录运行 npm install @frigade/assist-api,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.0.0 || ^19.0.0)、react-dom(^18.0.0 || ^19.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@frigade/assist-api 支持 TypeScript 吗?

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

@frigade/assist-api 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@frigade/assist-api 可以商用吗?

@frigade/assist-api 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@frigade/assist-api 的下载量有多少?

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

@frigade/assist-api 还在维护吗?

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