Function: readAuditHeaders()
@kortexya/reasoninglayer / readAuditHeaders
Function: readAuditHeaders()
Section titled “Function: readAuditHeaders()”readAuditHeaders(
headers):AuditResponseHeaders
Defined in: src/utils/audit-headers.ts:120
Read the audit ledger’s x-osfkb-* response headers.
Parameters
Section titled “Parameters”headers
Section titled “headers”Headers
The response headers: response.headers inside an
Interceptor, or ApiError.headers on a failure.
Returns
Section titled “Returns”Each header’s value, or null where the response carries none.
Remarks
Section titled “Remarks”x-osfkb-audit-record is the id to pass as
AuditCausalHeaders.causedBy on the next request, and to read with
client.compliance.getRecord. When auditError is set, that record does
not exist.
Example
Section titled “Example”let lastRecord: string | null = null;const client = new ReasoningLayerClient({ baseUrl, tenantId, auth: { mode: 'cookie' }, interceptors: [ async (request, next) => { const response = await next(request); lastRecord = readAuditHeaders(response.headers).auditRecord; return response; }, ],});