summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-19 10:30:56 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-19 10:30:56 +0800
commitfad30f64dd061fb8c98fe64f6596e1785c8babeb (patch)
tree1c6ec4a7f6f875ed8879e3003c1078224a3832dc
parent217a3c95a55b54573cda808abdeed7d406437a38 (diff)
The JS getToken
-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>