Documenso
Use Documenso for MainSDK document signing - open-source e-signatures, self-hosted or cloud, main.yaml, testing and swapping.
Documenso is an open-source document signing platform you can host yourself or use as a hosted service. The documenso driver behind pdf is planned to handle signing, so contracts and consent forms your app renders can be signed. Pick it when you need e-signatures and want the option to self-host.
Interfaces it serves
Pick Documenso in main.yaml for any of these. Your calls stay the same, and you can swap later.
pdfPreviewDriver documenso DocumensoPlanned driver
signing only; phase 3
pdf:
driver: documensoBefore you start
- Run Documenso yourself or create a hosted account.
- Create an API token for your app and store it in your secrets manager.
Configure
pdf:
driver: documensoHow the driver takes its token and instance address, and whether pdf.render still uses the built-in renderer with this driver, are not defined yet.
Use it
Rendering a contract works today with the built-in renderer:
"use server";
import { auth, pdf } from "mainsdk";
export async function renderContract(req: Request, contractId: string) {
const session = await auth.require(req);
return pdf.render("contract", { contractId, locale: session.user.locale });
}The signing call, what it takes and what it returns, is not defined yet.
Local development and testing
createTestApp() from @mainsdk/testing runs pdf on its in-memory fake. A self-hosted Documenso on your machine lets you try real signing. chaos.on("pdf", { outage: true }) simulates the service being down.
What MainSDK adds on top
- Documents localised through
i18nbefore they are signed. - The same render and signing calls on every driver, once signing is built.
See PDF documents.
Limits and notes
pdfis owned by specdocuments; the Documenso driver is listed in the catalog and requirements.- Signed documents and signer details live in Documenso. Self-host in your MainSDK data region (US, EU or India) if residency matters.
- Share signed copies through getqr.id with
share(), not through your own links.
Swap to or from it
pdf:
driver: documenso # was builtinFAQ
Can I self-host Documenso? Yes, it is open source. Point the driver at your instance once its keys are defined.
Next
Open questions
Was this page helpful?