Update variantProperties of an instance in figma

I got this information about this URL
https://www.figma.com/plugin-docs/api/properties/nodes-variantproperties/

How can I update variant properties of an instance? Any example please?