# Examples

> Three short Node.js scripts, each run in this repository: generate every table, prove the run, and check that two runs are identical.

Section: SDK · Type: example · Last updated: 2026-09-14

These are the calls the website’s own build makes to put real generated rows on the homepage, so they are known to run.

## Generate every table

```ts
const fs = require('node:fs');
const wl = require('./packages/sdk-node/index.js');

const recipe = JSON.parse(fs.readFileSync('examples/homepage-demo.wl.json', 'utf8'));
const run = wl.generateAll(recipe, { seed: recipe.seed });

for (const t of run.tables) {
  const [header, ...rows] = t.rows;   // rows[0] is the header row
  console.log(t.entity, header.join(','), rows.length, 'rows');
}
```

Prints Customer and Order with their columns and counts.

## Prove the run

```ts
const proof = wl.prove(recipe, { seed: recipe.seed });
console.log(proof.passed, proof.realism.overall);          // true 100
console.log(proof.receipt.content_hash);                   // sha256:…
for (const m of proof.realism.metrics) console.log(m.status, m.label);
```

The receipt block is what /verify recomputes.

## Two runs, one hash

```ts
const a = JSON.stringify(wl.generateAll(recipe, { seed: 7 }));
const b = JSON.stringify(wl.generateAll(recipe, { seed: 7 }));
console.log(a === b);                                      // true
```

This is the property the website build relies on before it publishes the homepage preview.

## Related

- [SDK API](https://theworklens.com/docs/reference/sdk-api): Every function the Node.js SDK exports — generate, prove, inspect, read a file, manage packs — with what each returns.
- [Seeds & determinism](https://theworklens.com/docs/generate/seeds): Same recipe, same seed, same bytes — on any machine. What that guarantee covers, and the three things that change the output.
- [Receipts](https://theworklens.com/docs/proof/receipts): What a run’s proof report contains, field by field, with a real one — and the line between what it proves and what it does not.

_← Previous: [Runtimes](https://theworklens.com/docs/sdk/runtimes) · Next: [Examples](https://theworklens.com/docs/examples) →_

_Canonical: https://theworklens.com/docs/sdk/examples · This copy: https://theworklens.com/docs/sdk/examples.md_
