@anvilco/react-signature-frame

中文文档
1.9.2发布于 2025/10/31MITTypeScriptCommonJS零依赖近 30 天下载 9826

The AnvilSignatureFrame React component for embedded Etch signatures

原始使用文档
文档目录17 节
  1. What is Anvil?
  2. Usage
  3. Props
  4. signURL
  5. scroll
  6. onLoad
  7. onFinishSigning
  8. onError
  9. onFinish (deprecated)
  10. enableDefaultStyles
  11. iframeWarningProps
  12. Styling
  13. Anvil Etch E-Sign Docs
  14. Links 🔗
  15. Notes
  16. Bugs
  17. Questions or Feedback

(Deprecated) AnvilSignatureFrame

A very minimal component that allows you to embed Anvil Etch e-signatures in your app with an iframe. It will give you information via callbacks through the signing process lifecycle.

See the live demo and open-source demo repository for a usage example.

image

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/react-signature-frame
npm install @anvilco/react-signature-frame
import AnvilSignatureFrame from '@anvilco/react-signature-frame'

<AnvilSignatureFrame
  signURL={signURL}
  scroll="smooth"
  onLoad={() => setLoading(true)}
  onFinishSigning={(payload) => console.log(payload)}
  onError={(errorPayload) => console.log(errorPayload)}
/>

Props

signURL

string (required) - A URL to the Anvil signature page generated from the generateEtchSignURL GraphQL mutation. The signature frame will be displaying the signing page through this URL.

Example:

signURL={`https://app.useanvil.com/etch/8iJDbq8dkEmjrsNw7Dnb/sign?token=dsa...`}

scroll

string | null - Optionally scroll to the signing frame

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

onLoad

function - This function is called when the signing page has finished loading.

Example:

onLoad={() => setLoading(false)}

onFinishSigning

function - A callback function with payload as a parameter. It is called when a user has successfully finished signing.

Example:

onFinishSigning={(payload) => console.log(payload)}

/*
{
  action: "signerComplete",
  signerEid: "kJzR6mcIWKoZs6KOxV4w",
  signerStatus: "completed",
  nextSignerEid: "HRLhx4khticpfxsUFSpj",
  documentGroupEid: "9fQnvfy51p7oKrEYajMh",
  documentGroupStatus: "partial",
  etchPacketEid: "J1phQTO6WQH6gZcMJAG5", // If from an EtchPacket
  weldDataEid: "J1phQTO6WQH6gZcMJAG5", // If from a workflow
}
*/

onError

function - A callback function with an error-specific payload as a parameter. It is called when a user experienced an error while attempting to sign. See the docs for details on how to recover from errors.

Example:

onError={(payload) => console.log(payload)}

/*
{
  action: "signerError",
  errorType: "tokenExpired", tokenExpired || tokenInvalid || notFound
  error: "Token Expired",
  message: "Error specific message",
  signerEid: "kJzR6mcIWKoZs6KOxV4w",

  // depending on the errorType, you may or may not receive the following
  signerStatus: "sent",
  nextSignerEid: "HRLhx4khticpfxsUFSpj",
  documentGroupEid: "9fQnvfy51p7oKrEYajMh",
  documentGroupStatus: "sent",
  etchPacketEid: "J1phQTO6WQH6gZcMJAG5", // If from an EtchPacket
  weldDataEid: "J1phQTO6WQH6gZcMJAG5", // If from a workflow
}
*/

onFinish (deprecated)

function - This function will have redirectURL as a parameter; called when a user has finished signing or experienced and error. Please use onFinishSigning and onError above.

Example:

onFinish={(redirectURL) => console.log(redirectURL)}

enableDefaultStyles

boolean (default: true) - Set to false to disable the default inline styles of the component.

iframeWarningProps

object - Pass in custom props into the paragraph tag displayed if the user's browser does not support iframes.

Example:

iframeWarningProps={{ className: 'warning-text' }}

Styling

Customize the component by disabling enableDefaultStyles and importing CSS or passing in inline styles. Override IDs or classNames by passing them in as props.

Anvil Etch E-Sign Docs

Read the Docs

Notes

  • To enable Iframe embedding: go to your organization's settings in Anvil, and enable "Iframe Embedding" in the API section.
  • 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].

版本与发布记录

@anvilco/react-signature-frame 共发布 17 个版本,首次发布于 2020/11/13;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.9.2latest2025/10/311 年前
1.9.02024/05/032 年前
1.8.32022/10/064 年前
1.8.22022/05/264 年前
1.8.12022/04/194 年前
1.8.02022/04/194 年前

关于 @anvilco/react-signature-frame 的常见问题

@anvilco/react-signature-frame 是什么?

The AnvilSignatureFrame React component for embedded Etch signatures

如何安装 @anvilco/react-signature-frame?

在项目目录运行 npm install @anvilco/react-signature-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/react-signature-frame 支持 TypeScript 吗?

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

@anvilco/react-signature-frame 支持 ESM 还是 CommonJS?

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

@anvilco/react-signature-frame 可以商用吗?

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

@anvilco/react-signature-frame 的下载量有多少?

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

@anvilco/react-signature-frame 还在维护吗?

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