E-signatures with JavaScript

A simple API for signing PDFs from your app. Set up an etch e-signature packet and use JavaScript to send or embed the e-sign experience.
Beyond giant hero assetGiant hero assetDesktop hero assetMobile hero assetTablet hero asset

Embed or send e-signature requests

Simple, legally binding e-signatures. Generate or upload a PDF, define the signers, and send out an e-signature request all over API.


JavaScript to signature

Use JavaScript to set up an Etch e-signature packet. Then send the packet for signature over email or directly from your app.

const variables = {
  name: `Test Docs - ${signerName}`,
  signatureEmailSubject: 'Custom email subject',
  signatureEmailBody: 'Custom please sign these documents....',
  files: [
    {
      id: 'sampleTemplate',
      castEid: pdfTemplateID,
    },
  ], data: {
    payloads: {
      // 'sampleTemplate' is the sample template ID specified above
      sampleTemplate: {
        data: {
          name: signerName,
          email: signerEmail,
        }
      }
    }, signers: [
    {
      id: 'signer1',
      name: signerName,
      email: signerEmail,
      signerType: 'email',
      // These fields will be presented when this signer signs.
      fields: [
        {
          fileId: 'sampleTemplate',
          fieldId: 'signature',
        }
      ]
    }
  ]
}

const anvilClient = new Anvil({ apiKey })
const { statusCode, data, errors } = await anvilClient.createEtchPacket({ variables })
const packetDetails = data.data.createEtchPacket
console.log('Visit the new packet on your dashboard:', packetDetails.detailsURL)

Try e-signatures now


Upload a PDF, create a free etch packet, and send to your signers using the demo below to see what you can automate with JavaScript and the Anvil e-signature API.

Get a Document AI demo (from a real person)

Request a 30-minute demo and we'll be in touch soon. During the meeting our team will listen to your use case and suggest which Anvil products can help.
    Want to try Anvil first?
    Want to try Anvil first?