summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html21
1 files changed, 12 insertions, 9 deletions
diff --git a/index.html b/index.html
index 1aecc6d..80bd3c6 100644
--- a/index.html
+++ b/index.html
@@ -8,16 +8,19 @@
<body>
<script src="https://unpkg.com/@shopify/app-bridge@3"></script>
<script src="https://unpkg.com/@shopify/app-bridge-utils@3"></script>
- <script async type="text/javascript" src="%s/js/index.js"></script>
<script async>
- Module.cwrap('index_getproducts', '',
- ['string', 'string'])(await
- window['app-bridge-utils']
- .getSessionToken(window['app-bridge']
- .createApp({
- apiKey: '%s',
- host: '%s'
- })), '%s');
+ async function getToken() {
+ Module.cwrap('index_getproducts', '',
+ ['string', 'string'])(await
+ window['app-bridge-utils']
+ .getSessionToken(
+ window['app-bridge']
+ .createApp({
+ apiKey: '%s',
+ host: '%s'
+ })), '%s');
+ }
</script>
+ <script type="text/javascript" src="%s/js/index.js"></script>
</body>
</html>