How do you traverse through all pages in a figma file with the API?

My plugin creates a new page in a user’s file. However, I don’t want it to create a new page every time they open the plugin. If the page has already been created, I want the outputs to appear on the same page that was created last time the user used the plugin.

In order to do this, I need a way to traverse all pages in a file and check whether or not the page with a specific name already exists.

How might I go about this? Not finding page traversal in the documentation.