Amber Shopify Project created using ReactJS+React-Redux with GraphQL API integration. Storefront Shopify API: https://github.com/Shopify/shopify-app-js/tree/main/packages/api-clients/storefront-api-client#readme
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

authentication.js 704B

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