Request e-signatures from your TypeScript app. Send documents to Anvil, collect legally binding signatures from any device.
const variables = {
name: `Test Docs - ${signerName}`,
signatureEmailSubject: 'Custom email subject',
signatureEmailBody: 'Custom please sign these documents....',
files: [
{
// Our ID we will use to reference and fill it with data.
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 } : Anvil.GraphQLResponse = await anvilClient.createEtchPacket({
variables,
})
const packetDetails = data?.data['createEtchPacket']
console.log('Visit the new packet on your dashboard:', packetDetails.detailsURL)
The @anvilco/anvil package is MIT-licensed and maintained in the open on GitHub.
$ npm install @anvilco/anvilInstall the Anvil Document SDK plugin in Claude Code and Claude will scaffold the SDK into your codebase — discovery, planning, and production-ready code.
/plugin marketplace add anvilco/anvil-plugins
/plugin install anvil-document-sdk@anvil-pluginsNo API key setup needed. The plugin connects to your Anvil account with OAuth and logs you in automatically.
Upload any PDF and watch Anvil Document AI identify input and signature fields, identify signers and connects them to fields. It's free - no signup required. Try an example below and see documentation when ready to send your own.