@anvilco/anvil-embed-frame

中文文档
2.2.2发布于 2025/10/31MITTypeScriptCommonJS零依赖近 30 天下载 18.3万

The AnvilEmbedFrame React component for embedded Etch signatures and Workflows.

原始使用文档
文档目录12 节
  1. What is Anvil?
  2. Usage
  3. Upgrading from v1 to v2
  4. Props
  5. iframeURL
  6. onEvent
  7. scroll
  8. Anvil Documentation
  9. Notes
  10. Bugs
  11. Questions or Feedback
  12. License

AnvilEmbedFrame

AnvilEmbedFrame is a very minimal React component that allows you to embed Anvil Etch e-signatures, Workflows, and embedded builders into your app with an iframe. It will give you information via callback onEvent.

See the Etch e-sign live demo and open-source demo repository for an embedded Etch e-sign usage example using this component.

What is Anvil?

Anvil provides easy APIs for all things paperwork.

  1. PDF filling API - fill out a PDF template with a web request and structured JSON data.
  2. PDF generation API - send markdown or HTML and Anvil will render it to a PDF.
  3. Etch E-sign with API - customizable, embeddable, e-signature platform with an API to control the signing process end-to-end.
  4. Anvil Workflows (w/ API) - Webforms + PDF + E-sign with a powerful no-code builder. Easily collect structured data, generate PDFs, and request signatures.

Learn more on our Anvil developer page.

Usage

yarn add @anvilco/anvil-embed-frame
npm install @anvilco/anvil-embed-frame
import AnvilEmbedFrame from '@anvilco/anvil-embed-frame'

<AnvilEmbedFrame
  iframeURL={etchSignURL || workflowURL || editorURL}
  onEvent={(eventObject) => console.log('Event object:', eventObject)}
  className="anvil-embed-frame"
  style={{ border: 'none' }}
/>

Upgrading from v1 to v2

Beginning in v2.0, the enableDefaultStyles prop has been removed. There are now no default styles embedded in the AnvilEmbedFrame, the frame will use default browser iframe styling. You can style the iframe with CSS and add className and style props to the component

Props

iframeURL

String (required) - A URL to the Anvil page you'd like to embed. For Etch e-sign, refer to these docs for instructions on generating the signing URL. For Workflows, refer to these docs for instructions on retrieving the Workflow URL.

Example

// Etch e-signatures
<AnvilEmbedFrame
  iframeURL="https://app.useanvil.com/api/etch/verify/QL3RjmpXWBD4W6YCHSLr?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzaWduZXJJZCI6MTg3LCJjbGllbnRVc2VySWQiOiJzaWduZXIxIiwiY3JlYXRlZEF0IjoxNjY0NTY4NTkyNTk0LCJleHRyYSI6IkNVQlIiLCJpYXQiOjE2NjQ1Njg1OTIsImV4cCI6MTY2NDY1NDk5Mn0.RMpoBXdAU5k6ozX3y2xoI8ykqx2BXycIKNX7Kq0EFFs"
/>

// For Workflows
<AnvilEmbedFrame
  iframeURL="https://app.useanvil.com/weld/my-org/my-workflow"
/>

onEvent

Function - This function is called when an event is triggered. Possible event types for Etch e-sign include: signerComplete, signerError. Possible event types for Workflows include: forgeSubmitPage, forgeComplete, weldComplete.

Defaults to (eventObject) => {}

scroll

String - Set scroll to the iframe

  • auto - scrolls the window to the iframe when mounted
  • smooth smoothly scrolls the window to the iframe when mounted
  • null - disables scrolling

Anvil Documentation

Notes

  • To enable iframe embedding, go to your organization's settings in Anvil, and enable "Iframe Embedding" in the API section.
  • Please contact us at [email protected] to enable iframe embedding for our embedded builders UIs: the PDF template builder, e-sign packet builder, or Workflow builder.
  • React >= v16.0 required.

Bugs

Please file an issue for bugs, missing documentation, or unexpected behavior.

Questions or Feedback

Please email us at [email protected].

License

MIT

版本与发布记录

@anvilco/anvil-embed-frame 共发布 7 个版本,首次发布于 2022/10/06;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.2.2latest2025/10/311 年前
2.2.02024/05/032 年前
2.1.12024/04/182 年前
2.1.02024/04/182 年前
2.0.02023/09/213 年前
2.0.0-alpha.02023/09/193 年前

关于 @anvilco/anvil-embed-frame 的常见问题

@anvilco/anvil-embed-frame 是什么?

The AnvilEmbedFrame React component for embedded Etch signatures and Workflows.

如何安装 @anvilco/anvil-embed-frame?

在项目目录运行 npm install @anvilco/anvil-embed-frame,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=16)、react-dom(>=16)、prop-types(^15.6.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@anvilco/anvil-embed-frame 支持 TypeScript 吗?

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

@anvilco/anvil-embed-frame 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@anvilco/anvil-embed-frame 可以商用吗?

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

@anvilco/anvil-embed-frame 的下载量有多少?

根据 npm 官方下载统计,@anvilco/anvil-embed-frame 在 2026/10/06 – 2026/11/04 这 30 天内被下载 183,457 次,日均约 6,115 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@anvilco/anvil-embed-frame 还在维护吗?

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