@frigade/js

中文文档
0.9.12发布于 2026/09/17ELv2TypeScriptESM + CJS构建来源已验证近 30 天下载 11.8万

The official Javascript SDK for Frigade.

原始使用文档
文档目录7 节
  1. Frigade Javascript SDK
  2. Install
  3. Usage
  4. API Reference
  5. Cross-platform support
  6. TypeScript support
  7. About Frigade

npm version npm version code style: prettier

Frigade Javascript SDK

The easiest way for developers to build high-quality product onboarding and education.


Frigade image

Install

Install the package from your command line.

With yarn

yarn add @frigade/js

With npm

npm install @frigade/js

Usage

Simply import { Frigade } from '@frigade/js' and use it. Example:

import { Frigade } from 'packages/js-api'

const frigade = new Frigade('FRIGADE_API_KEY')

await frigade.identify('USER_ID', {
  name: 'USER_NAME',
  email: 'USER_EMAIL',
  signed_up_at: 'USER_SIGNED_UP_AT' // ISO 8601 format
})

// Optional: send organization/group id
await frigade.group('ORGANIZATION_ID', {
  name: 'COMPANY_NAME',
})

API Reference

See full API Reference

Get a flow:

const flow = await frigade.getFlow('FLOW_ID')
// Flow data defined in config.yml in the Frigade dashboard
console.log('Flow status:', flow.isCompleted)
console.log('Flow data:', flow.rawData)

Marking a flow as completed:

const flow = await frigade.getFlow('FLOW_ID')
await flow.complete()

Marking a step in a flow as completed:

const flow = await frigade.getFlow('FLOW_ID')
const step = flow.steps.get('STEP_ID')
await step.start()
await step.complete()

Sending tracking events:

await frigade.track('EVENT_NAME', {
  property1: 'value1',
  property2: 'value2',
})

Event handlers

Global event handlers can be registered to be notified when any state change occurs in any flow. For example, to be notified when a flow is completed:

// This callback will be called when a the current user/group changes state in any flow
const callback = (updatedFlow, previousFlow) => {
  console.log('Flow state changed:', flow.isCompleted)
  console.log('Step state changed:', flow.steps.get('STEP_ID').isCompleted)
};

frigade.onStateChange(callback);
// To remove the callback use:
frigade.removeOnFlowStateChangeHandler(callback);

Flow specific event handlers can be registered to be notified when a specific flow changes state. For example, to be notified when a flow is completed:

// This callback will be called when a the current user/group changes state in the flow with id FLOW_ID
const flow = await frigade.getFlow('FLOW_ID')
const callback = (updatedFlow, previousFlow) => {
  console.log('Flow state changed:', flow.isCompleted)
  console.log('Step state changed:', flow.steps.get('STEP_ID').isCompleted)
};
flow.onStateChange(callback);

To only target a specific step in a flow, use:

// This callback will be called when a the current user/group changes state in the flow with id FLOW_ID and step with id STEP_ID
const flow = await frigade.getFlow('FLOW_ID')
const step = flow.steps.get('STEP_ID')
const callback = (updatedStep, previousStep) => {
  console.log('Step state changed:', step.isCompleted)
};
step.onStateChange(callback);

Cross-platform support

All non-UI related functionality of the SDK works in all JavaScript environments (Node.js, browser, React Native, etc.).

TypeScript support

This package contains TypeScript definitions of the frigade object.

About Frigade

Frigade is a developer-first platform for building quality product onboarding. A powerful, flexible API and native SDKs allow you to build onboarding 10x faster, experiment more easily, and drive customer success.

Frigade supports a series of use cases such as:

  • Registration: Maximize the number of users getting through your sign up flows with beautiful explainers, progress bars, and forms.
  • Activation: Convert more customers by taking them through a series of key onboarding items specific to their role, permissions, or goals.
  • Adoption: Introduce audiences to specific features that deliver value with native hotspots, tooltips, tours, and interactive product guides.
  • Engagement: Keep active customers engaged, announce new product features, and create lifecycle specific re-onboarding flows for dormant or churned customers.
  • Retention: Increase retention by delivering the right content at the right time, and by asking your users for feedback on the product.

Features

Component Library

Unstyled, ready-made components for building high‑quality user onboarding, faster. Onboarding checklists, tooltips, product walkthroughs, and much more. See components

Integrations

Integrations with Segment, Mixpanel, Posthog, and more to power targeting, analytics, and communications.

Content Management

Lightweight CMS built-in to update and test onboarding copy and content.

Versioning

Frigade makes it easy to manage multiple versions of onboarding across staging and production. Revisit previous versions of onboarding to see how they performed and make improvements.

Customer Journeys

Frigade automatically tracks state management and onboarding progress. Give your team full observability into the customer journey, and use Frigade to kick off automated workflows.

To learn more, visit frigade.com

版本与发布记录

@frigade/js 共发布 135 个版本,首次发布于 2023/07/17;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.9.12latest2026/09/171 个月前
0.9.112026/07/313 个月前
0.9.102026/07/303 个月前
0.9.92026/07/283 个月前
0.9.82026/05/026 个月前
0.9.72026/03/267 个月前

关于 @frigade/js 的常见问题

@frigade/js 是什么?

The official Javascript SDK for Frigade.

如何安装 @frigade/js?

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

@frigade/js 支持 TypeScript 吗?

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

@frigade/js 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@frigade/js 可以商用吗?

@frigade/js 使用 ELv2 许可。声明的许可为 ELv2,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

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

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

@frigade/js 还在维护吗?

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