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
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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