Extracting data points from Tableau visualization on a web page

Consider having various widgets on a screen and want to extract specific data attributes from those widgets for use outside of that widget or Tableau visualization. For example, an aggregate count from each widget and show a Javascript alert.

If within the report we already have those aggregate values defined, when making the JS Tableau visualization call, can we specify output values, in addition to the visualization for ETL outside of the Tableau visualization widget? If it is possible, can we output complex objects or only single-value attributes?

enter image description here

Doing this with some default Tableau visualization functionality would be optimal. However, one consideration is to make a second call to the visualization’s original data source to extract the required raw data.

Open to recommendations.