AssetSpec
The asset's content. type is required and determines the asset kind (PDF, HTML, image, CSS), which in turn determines whether the binary content is referenced via fileId or supplied inline as content.
- Binary types (
pdf,image) — upload the file first viaPOST .../files/upload-urland pass the returned ID infileId. - Text types (
html,css) — supply the content inline as a string incontent.
HTML assets additionally use htmlConfig to declare partials, styles, images, the viewModel schema, and PDF rendering options. HTML assets are wrapped by HTML templates and rendered via Handlebars.
- typeType: stringenumrequired
Asset kind — determines whether the binary lives at
fileId(binary) or inline atcontent(text).values- html
- image
- pdf
- css
- contentType: string
Inline text content. Required for
htmlandcssasset types. Pass the raw HTML source or CSS rules as a string. - fileType: string
Id Pattern: ^f_[0-9a-z]{26}$Reference to an uploaded binary file. Required for
pdfandimageasset types. Upload viaPOST .../files/upload-urlto obtain this ID. Prefixed lowercase ULID, e.g.f_01jv8m7qfj6xj9gkz7a4s2h8e. - htmlType: object
Config HTML-only. Declares assets the HTML template references (partials, styles, images), the viewModel schema, and PDF rendering options. Combined with the inline
content(a Handlebars template), this configures how the HTML renders to PDF.- dataType: object
Declares the schema the rendered viewModel (the JSON object passed to Handlebars as the root context) must conform to. Hosting templates validate the data they pass against this schema before rendering.
- imagesType: array object[]
Image assets the template references. The renderer resolves each entry to a signed URL and exposes it via the
{{asset_url 'alias'}}Handlebars helper — e.g.,<img src="{{asset_url 'logo'}}">. - partialsType: array object[]
Other HTML assets registered as Handlebars partials before rendering. Use
{{> alias}}incontentto inline a partial; nested partial references inside the included asset are resolved recursively.Data flow: a partial is just another HTML asset and carries its own
datadeclaration (the viewModel shape it expects). Whatever data the partial actually receives must conform to that schema.Wiring happens at the call site in
contentusing standard Handlebars syntax:{{> header}}invokes the partial against the caller's current context (which is the root viewModel by default — so the root viewModel itself must satisfyheader'sdataschema).{{> header employee}}scopes the partial toemployee; that scoped object then has to satisfy the schema.{{> header title="Welcome"}}passes hash arguments. It's on the parent template to make sure whatever it routes into a partial is the right shape — either by passing through the matching slice or by reshaping in its own viewModel transform.Use
roleMap(below) to rewrite signing-role placeholders when reusing the same partial under different concrete roles. - pdfType: object
Settings PDF rendering options applied when the HTML is converted to PDF. Defaults to
Letterif omitted. - stylesType: array object[]
CSS assets inlined into a
<style>block at render time, in the order listed. Cascade follows declaration order — later entries can override earlier ones. Only top-level styles are collected; styles declared on nested partials are ignored.
