Skip to main content
This script creates an Artifact, adds a second version, creates a temporary viewing link, publishes it to a permanent URL, and unpublishes it.

Install the SDK

Export CHECKFU_BASE_URL and CHECKFU_API_KEY. Save the following as publish.mts and run npx tsx publish.mts.
publish.mts
Comment out step 5 if you want to open the published URL before taking it down. If the address has changed by then, the unpublish request returns a conflict and leaves the replacement published. The viewing link stays pinned to version 2 even after you add version 3, while the publication follows each new version. To pin a publication to a specific version, publish again with { version: 1 } (the public address stays the same; see Publish an artifact). Publishing again after unpublishing assigns a new address.

Publish a live dashboard

The starter dashboard type renders one card per document in the numbers collection and refreshes every 30 seconds. The script reads the three template files from the checkout at ./checkfu, creates a dashboard from the type, and publishes it with read access so the page can query its data. Save this as dashboard.mts in your npm project and run npx tsx dashboard.mts from the project root.
dashboard.mts
To update a number, put its document again under the same ID; the live page refreshes within 30 seconds. The CLI uses --at-version to create a viewing link for a specific version.
Set ADDRESS to the publication.address returned by publish before taking it down.