|
@@ -0,0 +1,21 @@
|
|
1
|
+// import {createStorefrontApiClient} from '@shopify/storefront-api-client';
|
|
2
|
+
|
|
3
|
+// const client = createStorefrontApiClient({
|
|
4
|
+// storeDomain: 'http://amberdevstore.myshopify.com',
|
|
5
|
+// apiVersion: '2024-10',
|
|
6
|
+// publicAccessToken: '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',
|
|
7
|
+// });
|
|
8
|
+
|
|
9
|
+const adminApiClient = new shopify.clients.Rest({session});
|
|
10
|
+const storefrontTokenResponse = await adminApiClient.post({
|
|
11
|
+ path: 'storefront_access_tokens',
|
|
12
|
+ type: DataType.JSON,
|
|
13
|
+ data: {
|
|
14
|
+ storefront_access_token: {
|
|
15
|
+ title: 'This is my test access token',
|
|
16
|
+ },
|
|
17
|
+ },
|
|
18
|
+});
|
|
19
|
+
|
|
20
|
+const storefrontAccessToken =
|
|
21
|
+ storefrontTokenResponse.body['b3e24842a76e27e1d87206daededdab0']['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'];
|