@capitalos/react

中文文档
1.15.0发布于 2026/10/22MITTypeScriptESM + CJS近 30 天下载 7.4万

integrate CapitalOS into your react app

原始使用文档
文档目录9 节
  1. Requirements
  2. Installation
  3. npm
  4. yarn
  5. pnpm
  6. Documentation
  7. Usage
  8. Manage bank connections
  9. TypeScript support

CapitalOS for React

React components for integrating with CapitalOS

Requirements

React 16.8.0 or later

Installation

npm

npm install @capitalos/react

yarn

yarn add @capitalos/react

pnpm

pnpm add @capitalos/react

Documentation

Please refer to the official docs for more details.

Usage

In order to use the components you will need to obtain a client authentication token. refer to the CapitalOS documentation for more information.

import { App } from '@capitalos/react'

function MyComponent() {

  // ... obtain token from backend

  return (
    <App token={token}>
  )
}

Manage bank connections

ManageBankConnections supports admin users on approved, pending, and waiting accounts. It shows connected banks and lets the user add or reconnect accounts before approval. Other account statuses and non-admin users receive an error through the App's onError callback.

The standalone screen shows bank management without onboarding status copy. Eligibility is controlled by the deployed iframe, so existing SDK versions can use it without upgrading. Disconnecting a bank still requires the extended bank-connection actions feature and cannot remove the bank containing the default account. The separate AddBankAccount component requires an approved account.

TypeScript support

TypeScript definitions for @capitalos/react are built into the npm package and should be automatically picked up by your editor.

版本与发布记录

@capitalos/react 共发布 55 个版本,首次发布于 2024/02/17;过去 12 个月发布了 20 个版本。

版本发布日期距今
1.15.0latest2026/10/2218 天前
1.14.12026/10/1327 天前
1.14.02026/09/261 个月前
1.13.22026/09/231 个月前
1.13.12026/08/282 个月前
1.13.02026/08/242 个月前

其他发布通道:rc → 1.5.0-rc.1,alpha → 1.11.0-alpha.1。

关于 @capitalos/react 的常见问题

@capitalos/react 是什么?

integrate CapitalOS into your react app

如何安装 @capitalos/react?

在项目目录运行 npm install @capitalos/react,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=16.8.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@capitalos/react 支持 TypeScript 吗?

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

@capitalos/react 支持 ESM 还是 CommonJS?

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

@capitalos/react 可以商用吗?

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

@capitalos/react 的下载量有多少?

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

@capitalos/react 还在维护吗?

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