@frigade/assistant

中文文档
1.6.0发布于 2026/11/13SEE LICENSE IN LICENSETypeScriptES Module近 30 天下载 1.8万

Frigade Assistant - An in-product assistant that learns your software by using it

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

@frigade/assistant

Frigade Assistant: an in-product assistant that answers your users' questions inside your web app.

Install

npm install @frigade/assistant

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

Usage

import * as FrigadeAssistant from '@frigade/assistant';

FrigadeAssistant.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.

Controls

FrigadeAssistant.show(); // open the assistant, ready for a question
FrigadeAssistant.hide(); // take it off the page; it keeps running
FrigadeAssistant.close(); // end the conversation, back to the collapsed button
FrigadeAssistant.ask({ question: 'What can you do?' });
FrigadeAssistant.getMode(); // 'pre-init', 'hidden', 'collapsed', 'input', ...

Calls made before the assistant has mounted are queued and run once it does. getMode() returns 'pre-init' until then.

Events

const unsubscribe = FrigadeAssistant.on('ask', ({ query }) => {
  console.log('User asked', query);
});

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.
defaultVisiblebooleanWhether the assistant is visible on load. Defaults to true.

See the FrigadeAssistantConfig type for the full list.

License

See LICENSE.

版本与发布记录

@frigade/assistant 共发布 11 个版本,首次发布于 2026/09/29;过去 12 个月发布了 11 个版本。

版本发布日期距今
1.6.0latest2026/11/133 天前
1.5.12026/11/0412 天前
1.5.02026/11/0313 天前
1.4.22026/10/3017 天前
1.4.12026/10/2917 天前
1.4.02026/10/2917 天前

关于 @frigade/assistant 的常见问题

@frigade/assistant 是什么?

Frigade Assistant - An in-product assistant that learns your software by using it

如何安装 @frigade/assistant?

在项目目录运行 npm install @frigade/assistant,或使用 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/assistant 支持 TypeScript 吗?

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

@frigade/assistant 支持 ESM 还是 CommonJS?

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

@frigade/assistant 可以商用吗?

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

@frigade/assistant 的下载量有多少?

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

@frigade/assistant 还在维护吗?

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