Skip to main content
These examples describe the current Bijection CLI and SDK source. Use builds from the same source commit for these APIs. The public CLI and npm SDK are published independently and may lag this reference.
This page assumes the documents library is placed at docs with a renderer, as in generate your first document.

Generate from your own function

docs.helpers.generate(ctx, request, { then }) writes the report rendering and submits its render task in your transaction, with the bytes of the images it draws (at most 50, 8 MiB in all). The request names a space, the formats (pdf, docx, pptx, csv, images) and either a doc, whose current text is compiled with each embed captured by your capture adapters, or a document your app composed with report from @bijectionhq/library-documents. With then, the helper also submits a task to docs.ready, which settles when the report does: { report, state: "ready" | "failed", digest, error }. Your continuation is the next step of the flow.
bijection/briefs.ts
A render that never answers expires the ready task. A reaction on the report table sees every report settle as well: mutation({ on: docs.tables.reports.changes, roles: [editor] }, …).

Release a report

A report stays at the library’s label. Releasing it copies its files to a lower audience through a declared release. Give the library a publish option:
reports.release({ space, report }), or docs.helpers.release(ctx, { space, report }) in your own function, runs gate under the documents’ label, opens the report’s files, stores the copies through the release (ctx.store(input, { label, release })), writes the publication fact at the audience’s label and runs onRelease, all in one transaction. A function that calls the helper declares the release in its releases. Releasing again answers the first release and runs nothing. Audience roles read the copies through published.list.

Lifetime

Reports are deleted after renderer.lifetime (30 days by default). Uploads no render claims are dropped after a day, and a file no fact keeps is retired by the host. The document deliverables example shows a report flow with review before release.