Assets and documents

This guide explains how to work with static assets and generated documents inside the KASKO webapp framework, including how to access them in JsonLogic and content strings.

Overview

  • Assets are static files (images, PDFs, etc.) that are attached to items, quotes, policies, offers, or claims.

  • Documents are generated files produced by backend requests (for example, policy certificates) and may require polling before they are ready.

Item Assets

Static assets defined at the item/product level:

{
  ref: string,    // Reference name (e.g., "logo", "terms_pdf")
  url: string     // Asset URL
}

Accessing Item Assets in JsonLogic

{ "var": "asset.logo" }

Accessing Item Assets in Content

{asset.logo}

Generated Documents

Documents are generated after API requests (quote, policy, offer, lead) and may require polling.

Document Structure

Document Tokens in Content

You can render document links in content using:

Format:

Examples:

  • document.policy.certificate.url

  • document.offer.terms.url

  • document.lead.offer.name

Document Polling

For async document generation, use the poll-documents component:

The component polls for document status and updates state when documents are ready.

Policy and Offer Assets

Assets attached to policies or offers after creation:

Accessing Policy/Offer Assets in JsonLogic

Tips

  • Use content tokens for links so URLs can be surfaced in translations.

  • If documents are not immediately available, include poll-documents in your flow and render links after the status is ready.

  • Prefer asset.* for static item assets and document.* for generated files.

Last updated