Kaynağa Gözat

add initial setup shopify api

api-template
davey 4 gün önce
ebeveyn
işleme
1a77f1899a

+ 21
- 0
API/shopify/storefront/authentication.js Dosyayı Görüntüle

@@ -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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'];

+ 13
- 0
API/shopify/storefront/storefrontClient.js Dosyayı Görüntüle

@@ -0,0 +1,13 @@
1
+const shopify = require('@shopify/shopify-api'); // Adjust import based on your environment
2
+
3
+// Load the access token and shop
4
+const storefrontAccessToken = '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'; // Replace with your actual access token
5
+const shop = 'amberdevstore.myshopify.com'; // Replace with your actual shop domain
6
+
7
+// Create and export the storefront client
8
+const storefrontClient = new shopify.clients.Storefront({
9
+  domain: shop,
10
+  storefrontAccessToken,
11
+});
12
+
13
+module.exports = storefrontClient;

+ 4
- 0
API/shopify/storefront/to_do_list.txt Dosyayı Görüntüle

@@ -0,0 +1,4 @@
1
+1. product tag
2
+2. product sort by date and name
3
+3. product suggested ( tagging?? )
4
+4. buang product replace with new product

Loading…
İptal
Kaydet