Trouble Linking Angular Frontend with Shopify's Admin API via REST

Using Angular’s HttpClient to retrieve Shopify store details triggers CORS and authentication issues. Below is a revised code snippet:

export class ShopifyHandler {
  constructor(private service: HttpClient) {}
  retrieveStoreInfo() {
    const endpoint = '/admin/api/2023-01/shop.json';
    const reqHeaders = {
      'Access-Control-Allow-Origin': '*',
      'Content-Type': 'application/json',
      'X-Shopify-Access-Token': 'YOUR_TOKEN'
    };
    return this.service.get(endpoint, { headers: reqHeaders });
  }
}

hey, i ran into a similar issue. i solved it by shifting the auth to a backend endpoint, so shopfy doesn’t block the call. try handling the token on your server instead.

hey, have u tried running a proxy to handle the shopfy calls? it might bypass some cors probs and device token issues. has anyone seen better ways? keen to hear other experinces!