# @checkout\.com/checkout-web-components 中文文档

规范地址：https://npmcn.com/package/%40checkout.com/checkout-web-components/

版本：2\.0\.0
npm 元数据更新时间：2026-11-05T10:25:55.673Z
中文译文更新时间：2026-11-09T11:44:29.854Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40checkout.com/checkout-web-components
原文对照：https://npmcn.com/package/%40checkout.com/checkout-web-components/?lang=original
项目主页：https://github.com/checkout/checkout-web-components#readme
源码仓库：https://github.com/checkout/checkout-web-components

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：330 kB，8 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：0 个
- 首次发布：2023-10-05T11:59:50.557Z
- 最新版本发布：2026-11-05T10:25:55.449Z
- 近 30 天下载量：311795（2026-10-10 至 2026-11-08，npm 官方下载统计）
- 已发布版本数：24（近 12 个月 10 个）

## 中文简介

取出付款组件加载器

## 安装

```sh
npm install @checkout.com/checkout-web-components
```

也可以使用：`pnpm add @checkout.com/checkout-web-components`、`yarn add @checkout.com/checkout-web-components`、`bun add @checkout.com/checkout-web-components`

## README

# 退出网络组件装入器

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://npmcn.com/package/%40checkout.com/checkout-web-components/LICENSE)

> 测试WebContinents的装入器.

* * *

## 目录

-   [退出网络组件装入器](https://npmcn.com/package/%40checkout.com/checkout-web-components/#readme-checkoutwebcomponents-loader)
    -   [目录](https://npmcn.com/package/%40checkout.com/checkout-web-components/#readme-table-of-contents)
    -   [文档](https://npmcn.com/package/%40checkout.com/checkout-web-components/#readme-documentation)
    -   [安装](https://npmcn.com/package/%40checkout.com/checkout-web-components/#readme-installation)
    -   [使用量](https://npmcn.com/package/%40checkout.com/checkout-web-components/#readme-usage)
    -   [示例](https://npmcn.com/package/%40checkout.com/checkout-web-components/#readme-example)
    -   [许可证](https://npmcn.com/package/%40checkout.com/checkout-web-components/#readme-license)

* * *

## 文档

欲了解如何使用 " 抽查网 " 组件的更多信息,请参见: [检查Web 组件文档](https://www.checkout.com/docs/payments/accept-payments/accept-a-payment-on-your-website/get-started-with-flow)。 。 。 .

## 安装

使用 `npm` 安装软件包.

```bash
npm install @checkout.com/checkout-web-components
```

* * *

## 使用量

这个 `loadCheckoutWebComponents` 函数是库的切入点.

函数返回 a `Promise` 解决方式 `CheckoutWebComponents` ,并处理装入 `CheckoutWebComponents` 剧本. 然后,这个实例可以用来创建一个可以挂载的流程组件.

```js
import { loadCheckoutWebComponents } from '@checkout.com/checkout-web-components';
```

* * *

## 示例

```js
// Insert your public key here
const publicKey = '{your_public_key}';

// Initialise a new Checkout Web Components instance
const checkout = await loadCheckoutWebComponents({
  paymentSession,
  publicKey,
  environment: 'sandbox'
});

// You can now create and mount a Flow component using 'checkout'
const flowComponent = checkout.create('flow');

// Mount Flow component to div element with an ID of 'flow-container'
flowComponent.mount('#flow-container');
```

您可以在您的开发者部分找到/创建您的公钥 [Checkout.com 出品 Dashboard 游戏机](https://dashboard.checkout.com/) 或者说 [Checkout.com Sandbox Dashboard 页面存档备份,存于互联网档案馆](https://dashboard.sandbox.checkout.com/)见我们 [API 密钥文档](https://www.checkout.com/docs/business-operations/use-the-dashboard/developers#Manage_API_authentication) 更多信息.

* * *

## 释放

-   将常规承诺的公关合并为 `main`。 。 。 .
-   请打开或更新该版本起伏的版本 PR `CHANGELOG.md`。 。 。 .
-   将发行PR合并以创建 GitHub 发行并发布到 npm.
-   Fallback: 手动创建 GitHub Release以触发发布.

* * *

## 许可证

本项目根据以下规定获得许可证: [MIT 许可证](https://npmcn.com/package/%40checkout.com/checkout-web-components/LICENSE)。 。 。 .

## 常见问题

### @checkout\.com/checkout-web-components 是什么？

取出付款组件加载器

### 如何安装 @checkout\.com/checkout-web-components？

在项目目录运行 npm install @checkout\.com/checkout-web-components，或使用 pnpm add / yarn add / bun add。

### @checkout\.com/checkout-web-components 支持 TypeScript 吗？

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

### @checkout\.com/checkout-web-components 支持 ESM 还是 CommonJS？

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

### @checkout\.com/checkout-web-components 可以商用吗？

@checkout\.com/checkout-web-components 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @checkout\.com/checkout-web-components 的下载量有多少？

根据 npm 官方下载统计，@checkout\.com/checkout-web-components 在 2026/10/10 – 2026/11/08 这 30 天内被下载 311,795 次，日均约 10,393 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @checkout\.com/checkout-web-components 还在维护吗？

最新版本 2\.0\.0 发布于 2026/11/05（4 天前）；至今共发布 24 个版本，其中过去 12 个月发布了 10 个；首次发布于 2023/10/05。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

