Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pieroenrico/tune-me-in/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Theshopify.config.js file contains the configuration for connecting your Shopify Hydrogen storefront to both Shopify and Sanity CMS. This configuration is passed to the ShopifyServerProvider and used throughout the application to fetch products, collections, and content.
Configuration File
Location:shopify.config.js (project root)
Configuration Options
Your Shopify store domain. This is the myshopify.com domain for your store.Example:
'sanity-dev-store.myshopify.com'Format: your-store-name.myshopify.comHow to find: Available in your Shopify admin under Settings > DomainsYour Shopify Storefront API access token. This token allows your Hydrogen app to access your store’s data via the Storefront API.Example:
'791dbd01268e4a7129288e24b1012710'How to create:- Go to Shopify Admin > Apps > Develop apps
- Create a new app or select an existing one
- Configure Storefront API scopes
- Generate and copy the Storefront API access token
The locale/language code for your storefront. This affects language-specific content, currency formatting, and date formatting.Example:
'en-us'Common values:'en-us'- English (United States)'en-gb'- English (United Kingdom)'fr-fr'- French (France)'de-de'- German (Germany)'ja-jp'- Japanese (Japan)
The Shopify Storefront API version to use. This determines which API features and behavior your application uses.Example:
'unstable'Common values:'unstable'- Latest features, may change'2024-01'- January 2024 stable version'2023-10'- October 2023 stable version'2023-07'- July 2023 stable version
'unstable' during development, but switch to a stable version for production. Shopify releases new API versions quarterly.Version support: Each API version is supported for at least 12 months after release.The Sanity CMS configuration object imported from
sanity.config.js. This integrates content management capabilities into your Shopify storefront.Type: Sanity configuration objectProperties:projectId- Sanity project IDdataset- Sanity dataset nameapiVersion- Sanity API versionuseCdn- Whether to use Sanity CDN
Usage in Application
The Shopify configuration is used to initialize the Hydrogen framework:Server Provider
Insrc/App.server.jsx:
Client Entry
Insrc/entry-client.jsx:
Vite Configuration
Invite.config.js:
Environment-Specific Configuration
For different environments, use environment variables:Environment Variables
Create a.env file in your project root:
Multi-Language Setup
For multi-language storefronts:Best Practices
Use Environment Variables
Use Environment Variables
Store sensitive configuration like
storefrontToken in environment variables:- Prevents accidental exposure in version control
- Allows different values per environment
- Improves security posture
Use Stable API Versions in Production
Use Stable API Versions in Production
While
'unstable' provides the latest features, use a stable version in production:- Prevents unexpected breaking changes
- Ensures consistent behavior
- Gives you control over when to upgrade
Monitor API Version Deprecation
Monitor API Version Deprecation
Shopify API versions are supported for 12 months:
- Subscribe to Shopify developer newsletters
- Plan upgrades before deprecation
- Test new versions in staging first
Validate Store Domain Format
Validate Store Domain Format
Ensure your
storeDomain is in the correct format:- Must be
*.myshopify.comdomain - Do not include
https://protocol - Do not include trailing slashes
API Version Migration
When upgrading to a new Shopify API version:- Review the changelog at Shopify API Release Notes
- Test in development with the new version
- Update GraphQL queries for any breaking changes
- Deploy to staging for integration testing
- Update production once validated
Related Configuration
- sanity.config.js - Sanity CMS configuration
Troubleshooting
Products Not Loading
Products Not Loading
Symptoms: Empty product lists, GraphQL errorsSolutions:
- Verify
storeDomainformat (should be*.myshopify.com) - Check that
storefrontTokenis valid and not revoked - Ensure Storefront API is enabled in your Shopify app settings
- Verify API scopes include necessary permissions
GraphQL Version Errors
GraphQL Version Errors
Symptoms: API errors about unsupported fields or typesSolutions:
- Check that
graphqlApiVersionis a valid version - Review deprecations for your current version
- Update queries to match the API version schema
- Use Shopify’s GraphiQL explorer to test queries
Locale/Currency Issues
Locale/Currency Issues
Symptoms: Wrong currency symbols, incorrect number formattingSolutions:
- Verify
localeformat islanguage-country(lowercase) - Ensure your Shopify store supports the specified locale
- Check that markets are configured in Shopify admin
- Confirm currency settings in Shopify match your locale
Authentication Errors
Authentication Errors
Symptoms: 401 or 403 errors when fetching dataSolutions:
- Regenerate
storefrontTokenin Shopify admin - Verify the token has correct Storefront API scopes
- Check that the token hasn’t been revoked
- Ensure the app is installed on the store