Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@anvilco/react-signature-modal
Advanced tools
The AnvilSignatureModal React component for embedded Etch signatures
A lightweight modal component that allows embedding Anvil Etch e-signatures via a modal popup in your app. It will give you information via callbacks through the signing process lifecycle. Compatible with mobile viewports with minimal dependencies.
See the live demo and open-source demo repository for a usage example.
Anvil provides easy APIs for all things paperwork.
Learn more on our Anvil developer page.
yarn add @anvilco/react-signature-modal
npm install @anvilco/react-signature-modal
import AnvilSignatureModal from '@anvilco/react-signature-modal'
import '@anvilco/react-signature-modal/dist/styles.css'
<AnvilSignatureModal
signURL={signURL}
isOpen={isModalOpen}
onClose={() => setIsModalOpen(false)}
onLoad={() => setLoading(false)}
onFinishSigning={(payload) => console.log(payload)}
onError={(errorPayload) => console.log(errorPayload)}
/>
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...`}
boolean - The modal is displayed if isOpen
is true.
function - This function is called when the X button is clicked on the top right corner.
Example:
onClose={() => setIsOpen(false))}
function - This function is called when the signing page has finished loading.
Example:
onLoad={() => setLoading(false)}
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
}
*/
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
}
*/
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)}
string - Pass in a query selector identifying the root of your app. Used to hide other page content while the modal is open for screenreaders and other accessibility purposes.
Default: #root
boolean -Show the close icon on the top right of the modal if true.
object - Pass in custom props into the paragraph tag displayed if the user's browser does not support iframes.
Example:
iframeWarningProps={{ className: 'warning-text' }}
object - Pass in custom props into the iframe tag displayed within the modal.
Example:
anvilFrameProps={{
id: 'my-modal',
style: { background: 'white' },
}}
object - Pass in custom props into the svg tag for the delete button displayed within the modal.
Example:
iconCloseProps={{ className: 'red-delete-button' }}
Customize the component by importing your own CSS stylesheet. Override IDs or classNames by passing them in as props.
Please file an issue for bugs, missing documentation, or unexpected behavior.
Please email us at support@useanvil.com.
FAQs
The AnvilSignatureModal React component for embedded Etch signatures
The npm package @anvilco/react-signature-modal receives a total of 342 weekly downloads. As such, @anvilco/react-signature-modal popularity was classified as not popular.
We found that @anvilco/react-signature-modal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.