> ## Documentation Index
> Fetch the complete documentation index at: https://filecheck.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Events

> Subscribe to the Element lifecycle: ready, status, facts, ui, error, proof, scene, and destroy.

Subscribe with `intake.on(event, handler)`. It returns an unsubscribe function.

| Event | Fires when | Payload |
| - | - | - |
| `ready` | The iframe is ready | `{ ui }` (resolved UI) |
| `status` | Job state changes | [`IntakeStatusPayload`](/content/docs/reference/status-payload/index.html) |
| `facts` | File measurements update | [`IntakeFacts`](/content/docs/reference/facts/index.html) |
| `ui` | UI changes after `update()` | the new UI |
| `error` | A recoverable iframe error | `{ code, message }` |
| `proof` | A soft-proof is ready | [`ProofPayload`](/content/docs/concepts/soft-proofing/index.html) |
| `scene` | The job's [3D Proof](https://filecheck.io/docs/concepts/3d-proofs.md) is ready for the product gallery, or no longer is | `{ viewer }` (`null` when no longer ready) |
| `destroy` | The element unmounts | — |

## Gate on status

The one event you must handle. Gate your submit button on `canProceed`:

```js theme={null}
intake.on('status', ({ canProceed, jobId }) => {
  submitBtn.disabled = !canProceed;
  hiddenJobIdInput.value = jobId ?? '';
});
```

## Drive custom logic with facts

`facts` fires alongside `status` with file measurements (dimensions in millimetres). Use it to drive a price preview or your own controls:

```js theme={null}
intake.on('facts', (facts) => {
  console.log(facts.aggregate.pageCount, facts.aggregate.width);
});
```

See [Facts](https://filecheck.io/docs/reference/facts.md) for the full shape, or [Connectors](https://filecheck.io/docs/element/connectors.md) to map facts onto page controls without custom code.

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.
