Migrating from ScriptTag api to theme extensions

Hello to all. Recently I send my application for review and was refused because my application uses the ScriptTag API to integrate into the store. The reviewer replied that it is necessary to add compatibility with the online-store 2.0. In the process of fixing i got the question, what to do with stores that do not support theme extensions?

The solution I came up with:

  1. Do not remove ScriptTag

  2. Add theme extension to support Online Store 2.0, integration via customizer.

  3. Add a switch to the admin panel that switches the online-store version to hide unnecessary settings in the admin panel.

Please tell me is this the right solution?

You have to verify support for app blocks on the main theme, see here https://shopify.dev/apps/online-store/verify-support

If app-block is found to be supported, Skip POST requests made to the Asset REST Admin API resource and the ScriptTag

If not, Make POST requests to the Asset and ScriptTag resource.

https://shopify.dev/apps/online-store/verify-support#specify-the-method-for-integrating-the-app

Hope this helps.