@fasterfixes/core

中文文档
0.4.0发布于 2026/11/12MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 2.7万

Core client library for the FasterFixes feedback widget. Handles API communication, feedback submission, and reviewer authentication.

原始使用文档
文档目录9 节
  1. Installation
  2. Usage
  3. API
  4. FasterFixesClient
  5. ApiError
  6. Utilities
  7. Types
  8. Constants
  9. License

@fasterfixes/core

Documentation · Website

Core client library for FasterFixes — the visual feedback tool for web applications.

This package provides the API client, types, and utilities used by the FasterFixes widget. Most users should install @fasterfixes/react instead, which includes this package automatically.

Installation

npm install @fasterfixes/core

Usage

import { FasterFixesClient } from "@fasterfixes/core";

const client = new FasterFixesClient({
  apiKey: "your-project-api-key",
});

// Fetch widget configuration
const config = await client.getConfig();

// Submit feedback
await client.createFeedback(
  {
    comment: "Button is misaligned on mobile",
    pageUrl: window.location.href,
    selector: "main > div > button",
    clickX: 150,
    clickY: 320,
  },
  reviewerToken,
  screenshotBlob, // optional
);

// Fetch feedback for a page
const { feedback } = await client.getFeedback(reviewerToken, pageUrl);

API

FasterFixesClient

MethodDescription
getConfig()Fetch widget configuration (enabled status)
getFeedback(token, url?)Fetch feedback items, optionally filtered by page URL
createFeedback(data, token, screenshot?)Submit new feedback with optional screenshot
updateFeedback(id, data, token)Update an existing feedback comment
deleteFeedback(id, token)Delete a feedback item

ApiError

Thrown by all client methods on non-OK responses. Extends Error.

PropertyTypeDescription
statusnumberHTTP status code
messagestringError message from the API
detailsunknownAdditional error details

Utilities

ExportDescription
generateSelector(element)Generate a best-effort CSS selector for a DOM element
generateSelectors(element)Generate multiple selector strategies and return the most stable as best
resolveElement(selector, strategies?)Find an element using the primary selector, falling back through strategies in priority order
captureElementContext(element, selectors)Capture rich context about a DOM element (description, React component path, nearby text)
getBrowserInfo()Detect browser name, version, OS, and viewport size
resolveReviewerToken()Resolve reviewer token from URL param (ff_token) or localStorage

Types

All TypeScript types are exported, including: WidgetConfig, WidgetPosition, FeedbackItem, FeedbackStatus, CreateFeedbackData, UpdateFeedbackData, SelectorStrategies, ElementContext, ClientOptions, Labels, and more.

Constants

Useful constants are also exported: FEEDBACK_STATUSES, WIDGET_POSITIONS, STATUS_COLORS, DEFAULT_LABELS, DEFAULT_WIDGET_COLOR, DEFAULT_WIDGET_POSITION.

License

MIT

版本与发布记录

@fasterfixes/core 共发布 12 个版本,首次发布于 2026/03/20;过去 12 个月发布了 12 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.4.0latest2026/11/122 天前
0.3.02026/10/2916 天前
0.2.02026/10/2718 天前
0.1.02026/09/271 个月前
0.0.82026/09/261 个月前
0.0.72026/05/295 个月前

关于 @fasterfixes/core 的常见问题

@fasterfixes/core 是什么?

Core client library for the FasterFixes feedback widget. Handles API communication, feedback submission, and reviewer authentication.

如何安装 @fasterfixes/core?

在项目目录运行 npm install @fasterfixes/core,或使用 pnpm add / yarn add / bun add。

@fasterfixes/core 支持 TypeScript 吗?

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

@fasterfixes/core 支持 ESM 还是 CommonJS?

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

@fasterfixes/core 需要什么版本的 Node.js?

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

@fasterfixes/core 可以商用吗?

@fasterfixes/core 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fasterfixes/core 的下载量有多少?

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

@fasterfixes/core 还在维护吗?

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