Skip to content

redactPayloadText

function redactPayloadText(params): string;

Defined in: src/redact.ts:210

Run a caller’s redaction hook over one execution payload or error name.

Offered as the single string it is, not parsed: a payload is opaque text that only sometimes happens to be JSON, and a hook that wants to scrub inside it can parse and re-serialize it itself. It is handed the text in full, before the capture cap trims it, so that parse has something valid to work on.

RedactPayloadTextParams

Redaction parameters

string

The text to inline; REDACTED when the hook redacted it

redactPayloadText({
field: 'input',
redact: ({ kind, value }) => (kind === 'payload' ? undefined : value),
stateId: 'ProcessOrder',
text: '{"token":"abc"}',
}); // => '[redacted]'

path is <stateId>.<field>, or execution.cause for the failure cause of the execution itself, which belongs to no single state.