<!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
        <div style="display:none" id="installUrl" data-url="<?php echo $installUrl; ?>">Go...</div>
        <script src="https://unpkg.com/@shopify/app-bridge@3"></script>
        <script type="text/javascript">

             var permissionUrl = document.getElementById("installUrl").getAttribute("data-url");
            //window.location.assign(installUrl)
          
         
                var apiKey='<?= SHOPIFY_API_KEY?>';
                const AppBridge = window['app-bridge'];
                let Redirect =AppBridge.actions.Redirect;
                const config = {
                    // The client ID provided for your application in the Partner Dashboard.
                    apiKey:apiKey,
                    // The host of the specific shop that's embedding your app. This value is provided by Shopify as a URL query parameter that's appended to your application URL when your app is loaded inside the Shopify admin.
                    host: new URLSearchParams(location.search).get("host"),
                    forceRedirect: true
                };
                const app = AppBridge.createApp(config);
                Redirect.create(app).dispatch(Redirect.Action.admin, permissionUrl);

          
            

           
         
        </script>
    </body>
</html>