Right now in my template phtml file I am using this code to fetch the data and log it:
console.log("Product Information: ", <?=json_encode($block->getProduct())?>);
But I am unable to fetch information when the user customises the product by changing the size or color of the product, I need that information that time as well.