How do I find interactive elements in a design using figma plugin api ?

I want to find all the interactive elements in a Figma design file. How do I do that ? I want to use the Figma plugin api for this ?

To find interactive elements in a file, you can use both the Plugin API and the REST API. In case of using the Plugin API, you need to check the reactions property on supported nodes; using the REST API—the interactions property.

Please see the following developer docs:

https://www.figma.com/developers/api#frame-props