01
Built-in purposes
| Purpose | Class | Meaning |
|---|---|---|
essential | Required | Security and consent evidence. Never disabled. |
analytics | Optional | Aggregate measurement and product understanding. |
marketing | Optional | Advertising, attribution, sale, or sharing. |
ai.inference | Restricted | Use a model to produce an immediate result. |
ai.training | Restricted | Use interactions to improve model weights. |
ai.eval | Restricted | Evaluate model or workflow quality. |
ai.human_review | Restricted | Expose data to a person for review. |
data.export | Restricted | Move data to an external recipient. |
02
Read a purpose
typescript
const state = await pactClient.getState()
if (state.purposes.analytics === true) {
startMeasurement()
}03