How can a custom application get the online domain names of a store using it?

We are developing a public app for Shopify App Store. The app has a page that is loaded embedded in a Store admin page to allow the merchant to make use of its functionality as well as theme extensions to allow for new functionality on the merchant’s online store.

To protect the app backend from non authorized use, is there a way for it to obtain a list of valid domains of the merchant’s online store?. Can this be done though API or by asking the merchant explicitly about them?

Found it. The https://shopify.dev/docs/api/admin-graphql/2024-04/objects/queryroot#field-queryroot-shop has the response I was looking for. The result from a sample grapql query that can be run from https://shopify.dev/docs/api/graphiql-admin-api can be seen in the snapshot below.