How to get Category Id in hierarchicalMenu widget transformItems response for magento 2?

I am customising algolia layered navigation in Magento 2 and facets is coming through hierarchicalMenu Widget. transformItems() method returns an item object that contains six field and i want to get categoryId field on that object.

Response for the items will be Hierarchical Menus Items Object field six fields.

How to get extra category id field on that items object?

Thank you.

I’ve have the same problem and I am also interested in knowing how this can be done.