Signature
Several people sign one PDF of the tenant, in person on a display or through a link. The last
signature moves the request to all-signed; a job renders a signature page, appends it to the
unchanged original and completes the request.
What it shows
Section titled “What it shows”- Feature -
createSignatureFeature({ retention, hostEntities, linkSecret, deliverLink, signaturePageUrl }). Needsfiles,user-data-rights(exports and erases signer data) andrenderer-puppeteer-client(prints the signature page); the test mounts user-data-rights with its own dependencies. - Host - every request belongs to a host row (
hostType,hostId, one ofhostEntities, here alease); a user sees and works on the request only while they can read that row. - deliverLink -
issue-linkhands the signing link to the app (mail) and returns only{ signerId, linkSentAt }: whoever may issue a link must not be able to sign with it. - Test -
setupTestStackand HTTP: request, issue-link, anonymous sign-by-link, sweep job, completed.
src/feature.ts the feature with a link outboxsrc/__tests__/feature.integration.test.ts request to completed request over HTTPSource code
Section titled “Source code”The feature entry point — embedded straight from the source file, so the code here is exactly what runs. Multi-file samples keep their remaining files next to it on GitHub (link below):
import { createSignatureFeature } from "@cosmicdrift/kumiko-bundled-features/signature";import { createEntity, createTextField, defineFeature } from "@cosmicdrift/kumiko-framework/engine";
export const leaseEntity = createEntity({ name: "lease", table: "recipe_signature_leases", fields: { name: createTextField({ required: true, maxLength: 100, personal: false, reason: "technical_reference", }), },});
// In an app the host is the record the document belongs to; a user sees its requests while they can read it.export const leaseFeature = defineFeature("signature-recipe-lease", (r) => { r.entity(leaseEntity);});
// In an app `deliverLink` sends a mail to the signer. The recipe keeps the links in a map so the// test can open them: the link is never part of a handler result.export const deliveredLinks = new Map<string, string>();
export const SIGNATURE_LINK_SECRET = "signature-recipe-link-secret-0123456789";
export const signatureFeature = createSignatureFeature({ retention: { keepFor: "10y", unfinishedKeepFor: "90d" }, linkSecret: SIGNATURE_LINK_SECRET, hostEntities: ["lease"], signaturePageUrl: "https://app.example/sign", deliverLink: async (_ctx, { signerId, url }) => { deliveredLinks.set(signerId, url); },});📄 On GitHub: samples/recipes/signature/src/feature.ts