# @finapi/embeddable-web-form 中文文档

规范地址：https://npmcn.com/package/%40finapi/embeddable-web-form/

版本：2\.104\.0
npm 元数据更新时间：2026-11-10T16:57:16.363Z
中文译文更新时间：2026-11-14T19:54:44.717Z
软件包许可：MIT

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

原始 npm 页面：https://www.npmjs.com/package/%40finapi/embeddable-web-form
原文对照：https://npmcn.com/package/%40finapi/embeddable-web-form/?lang=original

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

- 包体积（解压后）：7 kB，6 个文件
- TypeScript 类型：未声明
- 运行依赖：0 个
- 首次发布：2020-06-29T16:45:42.328Z
- 最新版本发布：2026-11-10T16:57:16.117Z
- 近 30 天下载量：2463（2026-10-15 至 2026-11-13，npm 官方下载统计）
- 已发布版本数：446（近 12 个月 76 个）

## 中文简介

用于整合 finAPI 可嵌入的 Web 格式的 Javascript 库

## 安装

```sh
npm install @finapi/embeddable-web-form
```

也可以使用：`pnpm add @finapi/embeddable-web-form`、`yarn add @finapi/embeddable-web-form`、`bun add @finapi/embeddable-web-form`

## README

# 一般情况

您可以使用我们的 npm 软件包整合可嵌入的网络形式 .

该包包含两个入门点——Javascript文件,和Typescript文件. 需要选择的入口由您决定 - 如果您的应用程序支持 Typescript 语言, 那么您可以随意使用 用于使用 **finapi-embeddable-web-form. 组件.ts** 文档. 如果您的应用程序不支持 Typescript 语言 - 请使用 **finapi-embeddable-web-form.js (英语)** 要导入库的文件.

为了使用我们包的最新版本, 请将版本值设置为 **时间轴:** 在您的主包。 json 文件.

# 整合示例

-   请将以下作为可嵌入的网络形式与Angular app之间这种融合的例子:

```
import {Component, OnInit} from '@angular/core';
import {WebFormBuilder} from "@finapi/embeddable-web-form/finapi-embeddable-web-form";

@Component({
    selector: 'app-webform',
    templateUrl: '../../../node_modules/@finapi/embeddable-web-form/finapi-embeddable-web-form.component.html',
})
export class WebformComponent implements OnInit {
    private webFormToken: string;
    constructor() {
        this.webFormToken = 'web-form-token was here';
    }

    ngOnInit(): void {
        console.log('WebForm library has been imported');

        var webFormComponents =
            new WebFormBuilder(this.webFormToken, 'http://kraken:8085')
                .withCallbackUrl('http://127.0.0.1/dummy')
                .withOwnerDocument(document)
                .build();
        webFormComponents.startWebFormComponents();
    }

}
```

-   可嵌入的web-form和ReactJS应用程序的整合的另一个实例:

```
import React from 'react';
import {WebFormBuilder} from '@finapi/embeddable-web-form/finapi-embeddable-web-form'

const serverUrl = 'http://kraken:8085';
const webFormToken = 'whatever';

function getWebForm() {
    let embeddableWebForm =
        new WebFormBuilder(webFormToken, serverUrl)
            .withOwnerDocument(document)
            .build();
    embeddableWebForm.startWebFormComponents();
}

const App = () => {
    return (
        <div>
            <button onClick={() => getWebForm()}>Render finAPI Web Form</button>
            <web-form-element></web-form-element>
        </div>
    );
};

export default App;
```

## 常见问题

### @finapi/embeddable-web-form 是什么？

用于整合 finAPI 可嵌入的 Web 格式的 Javascript 库

### 如何安装 @finapi/embeddable-web-form？

在项目目录运行 npm install @finapi/embeddable-web-form，或使用 pnpm add / yarn add / bun add。

### @finapi/embeddable-web-form 支持 TypeScript 吗？

该包的 package\.json 没有声明类型入口。需要类型提示时，可以在 npm 上查找社区维护的 @types/finapi\_\_embeddable-web-form 是否存在。

### @finapi/embeddable-web-form 可以商用吗？

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

### @finapi/embeddable-web-form 的下载量有多少？

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

### @finapi/embeddable-web-form 还在维护吗？

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

