Magento 2 How to get child item id of configurable product by super attribute details?

Let’s assume you know configurable product id and used child product super attribute details.
Example from Magento Sample data configurable product name Chaz Kangeroo Hoodie,  Configurable product id is 67.
Super attribute Array details,

Using the bove details how we can get details of child item.

Refer below code snippet for Get child item id of a Configurable product by child’s Attribute details.

Call function,

Result is 52(Product name Chaz Kangeroo Hoodie-XS-Black). Using above way we got the child item data.

How to get configurable product’s used super_attribute details programmatically in Magento 2?

We can get the details of the used super attribute value for the configurable product. You will get the attribute value used in the configurable product using below example.

Let’s assume configurable product generated with color and size attributes. But how we can get details of super attribute value using programmatic that configurable product is made using color or size or color and size or any other attributes.

We can get Dynamically Configurable Product’s used Super attribute details by below code snippet.

Call function from template file,
$productId = 67;
$superAttribute = $this->getSuperAttributeData($productId);

Result will be,
[93] => color
[254] => size

Where 93,254 are attribute id and color,size are attribute code. Based on output  we can say configurable product is made using color and size super attirbute.