@unlev/exeq
v0.1.12
Published
Embeddable PDF form builder and document signing — client-side, no backend required
Downloads
1,352
Maintainers
Readme
Exeq
Embeddable PDF form builder and document signing for the browser. Design form templates on any PDF, then let users fill and sign them — all client-side, no backend required. Your documents never leave the device.
Install
npm install @unlev/exeq
# or
yarn add @unlev/exeqQuick Start
import { DesignerView, SignerView } from '@unlev/exeq';
import '@unlev/exeq/styles';
// Template editor — open a PDF, place fields, export template
function Editor() {
return (
<DesignerView
apiKey="your-api-key"
initialPdfUrl="/contracts/blank.pdf"
onSave={(template) => {
// store the template JSON on your server
}}
/>
);
}
// Signing UI — load a template, pre-fill values, collect signed PDF
function Signer() {
return (
<SignerView
apiKey="your-api-key"
initialPdfUrl="/contracts/template.pdf"
initialTemplate={template}
initialSigner="Signer 1"
initialValues={{
"Full Name": "Jane Smith",
"Email": "[email protected]",
}}
onComplete={(blob) => {
// upload the signed PDF
}}
/>
);
}
// Multi-party signing — signers complete sequentially
function MultiPartySigner() {
return (
<SignerView
apiKey="your-api-key"
initialPdfUrl="/contracts/template.pdf"
initialTemplate={template}
signerOrder={['Signer 1', 'Sender']} // recipient signs first, then sender
onComplete={(blob) => {
// final PDF with all signatures
}}
/>
);
}API
DesignerView Props
| Prop | Type | Required | Description |
|------|------|----------|-------------|
| apiKey | string | Yes | Your Exeq API key |
| initialPdfUrl | string | No | URL to a PDF to pre-load |
| initialTemplate | Template | No | Existing template to resume editing |
| onSave | (template: Template) => void | No | Called on "Export Template". If omitted, downloads JSON. |
SignerView Props
| Prop | Type | Required | Description |
|------|------|----------|-------------|
| apiKey | string | Yes | Your Exeq API key |
| initialPdfUrl | string | No | URL to the PDF |
| initialTemplate | Template | No | Template with fields and signer roles |
| initialSigner | string | No | Signer role name (default: "Signer 1") |
| initialValues | Record<string, string> | No | Pre-fill fields by label (case-insensitive) or ID |
| callbackUrl | string | No | URL to POST the signed PDF to |
| onComplete | (blob: Blob) => void | No | Callback with the signed PDF Blob |
| submitLabel | string | No | Label for the final submit button (default: "Complete") |
| signerOrder | string[] | No | Signing order for multi-party docs. Signers complete sequentially. Defaults to non-Sender roles first, then Sender. |
Utilities
import { renderPdfPages, generateFilledPdf, downloadPdf } from '@unlev/exeq';
// Render PDF pages to images
const pages = await renderPdfPages(pdfUrlOrBytes);
// Generate a filled PDF with form values overlaid
const bytes = await generateFilledPdf(pdfSource, fields);
// Trigger browser download
downloadPdf(bytes, 'signed-document.pdf');Types
import type { FormField, Template, FieldType, RenderedPage } from '@unlev/exeq';Field Types
| Type | Description |
|------|-------------|
| text | Text input (subtypes: freeform, number, date, email, phone) |
| signature | Freehand signature drawing (supports ink color) |
| initials | Smaller freehand drawing for initials |
| signed-date | Auto-filled date when signer signs |
| checkbox | Toggle checkbox |
| blackout | Black redaction rectangle (designer only) |
| whiteout | White redaction rectangle (designer only) |
Additional Components
| Component | Description |
|-----------|-------------|
| PdfViewer | Low-level PDF page renderer with draggable field overlays |
| SignatureCanvas | Freehand signature/initials drawing canvas |
| FieldPropertyPanel | Field property editor (type, label, assignee) |
| FieldNavigator | Prev/Next navigation through signer fields |
| SignerRoleSelector | Manage signer roles |
Privacy
All PDF processing happens client-side in the browser. Documents are never uploaded to any server. The npm package is self-hosted — it bundles into your app and serves from your infrastructure.
Workflow
- Design — Use
<DesignerView />to open a PDF and place form fields - Pre-fill — Fill Sender fields (company name, your signature, etc.)
- Export — Capture the template JSON via
onSave - Sign — Render
<SignerView />with the template. UseinitialValuesfor mail-merge. - Collect — Receive the signed PDF via
onComplete
CDN Usage
For non-React apps, use the embed script:
<script src="https://unpkg.com/@unlev/exeq/dist/embed.global.js"></script>
<div id="signer" style="width:100%;height:800px"></div>
<script>
Exeq.sign({
target: '#signer',
apiKey: 'your-api-key',
pdf: '/contract.pdf',
fields: '/template.json',
onComplete: (blob) => { /* signed PDF */ }
});
</script>Documentation
Full docs at exeq.org/docs
License
MIT — Unleavened LLC
