SDK · Playground
Pick a recipe, hit Run to see the simulated output, or Open in StackBlitz to get a live Node.js environment with @unified-product-graph/sdk pre-installed and the recipe ready to edit and run.
Cookbook · Maintaining
Fail a pull request if the graph health score drops below a threshold. Two-file recipe: a script + a workflow.
Code
// scripts/upg-health.mjs
import { UPGClient } from '@unified-product-graph/sdk'
const upg = new UPGClient({ file: './product.upg' })
const { score, digest } = await upg.health()
console.log(JSON.stringify(digest, null, 2))
const THRESHOLD = 7
if (score < THRESHOLD) {
console.error(`Graph health ${score}/10 below threshold ${THRESHOLD}`)
process.exit(1)
}Output
// click ▶ Run to see what this snippet would print locally