Looking for the cleanest way to parse the v2.analytics.conversation.aggregate event payload. The JSON nesting is deep and inconsistent. Trying to extract the conversationId and metricValues in a Node.js consumer, but the schema keeps shifting.
{
"eventType": "v2.analytics.conversation.aggregate",
"payload": {
"conversationId": "123",
"data": [
{
"metricName": "handleDuration",
"metricValues": [{ "value": 120 }]
}
]
}
}
Accessing payload.data[0].metricValues[0].value feels brittle. Any standard pattern for this?