@josephomills/esign
v0.9.9
Published
Reusable, host-agnostic document e-signing: no-login signer links, drag-placed signatures, Level-1 cryptographically-sealed PDFs with a hash-chained audit trail, document versioning, group targeting via a SubjectsPort, coverage detection, and stats. Host
Maintainers
Readme
@josephomills/esign
Reusable, host-agnostic document e-signing for Next.js + Prisma/Drizzle apps.
Send a PDF to people for online signing without them logging in, place the signature with a drag-drop designer, capture a simple electronic signature, and return a Level-1 cryptographically-sealed PDF — the final flattened bytes are SHA-256 hashed and an appended audit-certificate page records a hash-chained event log. Track who has / hasn't signed, version documents and resend, detect subjects added after a send (coverage), and surface stats.
The package owns the engine; the host injects everything domain-specific through
ports — exactly like @firstlovecenter/milestone-grid:
import { configureEsign } from "@josephomills/esign/server";
import { createPrismaPersistence } from "@josephomills/esign/server/prisma"; // E1
export const esign = configureEsign({
persistence: createPrismaPersistence(prisma),
storage, // StoragePort — wraps your R2/S3
notifier, // NotifierPort — wraps your email/WhatsApp senders
auth, // AuthPort
subjects, // SubjectsPort — registerSubjectTypes([...]) for group targeting
hooks, // optional — onRequestSigned → mark a milestone-grid requirement
});Install
pnpm add @josephomills/esignThen paste the model fragment into your schema.prisma and migrate:
// node_modules/@josephomills/esign/prisma/esign-models.prismasubjectId is host-managed (= your profileId) and intentionally has no foreign
key — pass any opaque string. scopeId is optional (estate / country / none).
Status
Built in phases (see the host app's plan). E0 ships the contract: ports, DTOs, the token helper, the signing state machine, and the Prisma fragment.
License
MIT © Joseph Mills
