DocuSeal
Create DocuSeal PDF submissions with X-Auth-Token credentials and typed SignatureKit errors.
DocuSeal creates a PDF submission and returns submitter links. It is a provider request API, not a local signer layer.
Installation
npm install @signature-kit/http @signature-kit/docusealWhen to use
Use DocuSeal when an open-source remote signer should host the submission and collect signatures. Use local signing when SignatureKit must produce the final bytes itself.
Keep credentials Redacted
Provider tokens enter as Redacted.make(...) and are unwrapped only inside the package HTTP boundary. Never pass remote tokens to React components or logs.
Minimal request
import * as Alchemy from "alchemy"
import { DocuSealSignatureRequest, providers as docuSealProviders } from "@signature-kit/docuseal"
import { signatureHttpClientLive } from "@signature-kit/http"
import { Effect, Layer, Redacted } from "effect"
export default class Contracts extends Alchemy.Stack<Contracts>()(
"Contracts",
{
providers: Layer.merge(
docuSealProviders({
apiKey: Redacted.make(process.env.DOCUSEAL_API_KEY ?? ""),
baseUrl: "https://api.docuseal.com",
sendSms: false,
submittersOrder: "preserved",
}),
signatureHttpClientLive,
),
state: Alchemy.inMemoryState(),
},
Effect.gen(function* () {
return yield* DocuSealSignatureRequest("service-agreement", {
title: "Service agreement",
message: "Review and sign this document.",
documents: [{ fileName: "contract.pdf", mimeType: "application/pdf", contentBase64: pdfBase64 }],
recipients: [{ name: "Ada Lovelace", email: "ada@example.com", role: "signer" }],
send: true,
})
}),
) {}Provider facts
- Creates a PDF submission through DocuSeal’s API.
send: falsecreates a draft without emailing submitters.- Submitter order can be preserved when the upstream supports it.
Errors
Invalid input, remote HTTP failures, and invalid response shapes fail as SignatureKitError. The provider, operation, and HTTP status fields are preserved when the upstream response exposes them.
Related
How is this guide?