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 · Reading
List every feature, persona, or any other typed node. Avoid the wrapped-return gotcha.
Code
import { UPGClient } from '@unified-product-graph/sdk'
const upg = new UPGClient({ file: './product.upg' })
const { nodes, total } = await upg.nodes.list({ type: 'feature' })
console.log(`${total} features in graph`)
for (const feature of nodes) {
console.log(' ', feature.id, '·', feature.title)
}Output
// click ▶ Run to see what this snippet would print locally