Hi everyone,
I’m working on integrating the Shopify Storefront API into my website. I’m a beginner in this area, and I’d like to know if my approach is correct and whether it’s efficient and secure.
My Approach:
- Using CDN for Storefront API:
I’ll include the Shopify Storefront API client via a CDN:
<script src="
https://unpkg.com/browse/@shopify/[email protected]/dist/umd/storefront-api-client.min.js"></script>
- Connecting to Shopify:
• I’ll use my store domain (e.g., my-shop.myshopify.com),
• The latest API version (e.g., 2024-04), and
• My public storefront access token.
Here’s the client setup:
<script>
const client = ShopifyStorefrontAPIClient.createStorefrontApiClient({
storeDomain: 'my-shop.myshopify.com',
apiVersion: '2024-10',
publicAccessToken: '<your-public-access-token>',
});
</script>