Shop Setup
You can watch the video below to learn how to set up your shop in Pack and link your Shopify store to Pack. Please note you don't need to select 'Customer scopes' for a shop under Storefront API Scopes, even though the video below shows it.
Creating a Custom App for your Pack Account
Enable Shopify Custom Apps:
- From your Shopify admin, click Settings > Apps and sales channels.
- Click Develop apps.
- Click Allow custom app development.
- Review the provided information and click Allow custom app development.
To create a new Shop in Pack, link your Shopify store to Pack by creating and installing a Custom App in Shopify.
Steps to Create and Install a Custom App:
- From your Shopify admin, click Settings > Apps and sales channels.
- Click Develop apps.
- Click Create an app.
- Enter the App name and select an App developer in the modal window.
- Click Create app.
Configuring Your Custom App Permissions
To ensure Pack functions correctly, configure the following API scopes:
Admin API Scopes
Pack uses these scopes to synchronize and manage your store's products and assets.
Steps to Configure Admin API Scopes:
- In your Custom App, navigate to Configuration.
- Click Configure Admin API integration.
- Configure the following properties:
- Files:
write_files
,read_files
- Metaobject definitions:
write_metaobject_definitions
,read_metaobject_definitions
- Metaobject entries:
write_metaobject
,read_metaobjects
- Products:
read_products
- Shopify Markets (optional):
read_markets
,write_markets
- Store Content:
read_content
- Files:
- Verify all required scopes are selected and click Save.
Storefront API Scopes
These scopes are necessary for the Shopify Storefront API features, such as Metaobjects, Cart, Customer Account, and Market.
Steps to Configure Storefront API Scopes:
- In your Custom App, navigate to Configuration.
- Click Configure Storefront API integration.
- Configure the following properties:
- Metaobject entries:
unauthenticated_read_metaobjects
- Metaobject entries:
- Verify all scopes are selected and click Save.
Installing Your Custom App to Shopify and Obtaining API Keys
After configuring your API scopes, install the custom app on your Shopify store to obtain your API keys.
Steps to Install Custom App and Obtain API Keys:
- Click Install app.
- In the modal window, click Install.
- Navigate to API Credentials.
- Note down the Admin API access token and Storefront API access token.
- Remember, the Admin API access token is displayed only once.
Linking Your Shopify Store to Pack
After installing your Custom App in Shopify, create your new Shop in Pack Admin.
Steps to Link Shopify Store to Pack:
- Navigate to Pack Admin, click on your current instance, and select Create new instance.
- Select 'Create a shop', name your shop, and click next.
- Enter your shop URL
your-store.myshopify.com
. - Paste your Admin API access token.
- Paste your Storefront API access token.
- Click Connect and wait for confirmation.
- After confirmation, click Success, Continue to continue setting up your shop.
Preparing Your GitHub Repository
You will be prompted to connect your GitHub repository to Pack.
Steps to Connect GitHub Repository:
- Click Connect.
- Create a repository and name it.
- Click Create.
- Click Success, Continue to proceed.
Setting Up Your Hydrogen Storefront
The final step is to create a new Hydrogen Storefront on Shopify.
Steps to Set Up Hydrogen Storefront:
- Navigate to Shopify Admin and ensure you have the Hydrogen sales channel installed.
- Click Hydrogen.
- Click Create storefront.
- Name your storefront.
- Select the repository you created in the previous step.
- Click Create. This may take a moment.
- Click Storefront Settings > Environment and Variables, and copy your Pack environment variables.
- Click on Add variable in Custom Variables section: Add the key, value, and select all environments. Click Save.
- Repeat this step for all variables shown in Pack.
- Navigate to your GitHub repository and merge the pull request created by Shopify.
- Once deployment is complete, navigate back to Pack and click Continue.
- In Your Storefront Details, paste the following:
- Public Storefront URL: Your Hydrogen Storefront URL. Navigate to your Hydrogen Store > Storefront Settings > Environment and Variables > Production, set the URL as public, and click Save.
- Storefront ID: Your Hydrogen Storefront ID. Find it in the URL bar of your Hydrogen Storefront right after the
hydrogen/
part of the URL.
- Public Storefront URL: Your Hydrogen Storefront URL. Navigate to your Hydrogen Store > Storefront Settings > Environment and Variables > Production, set the URL as public, and click Save.
- Click Done, Continue to finish the setup.
Hydrogen Storefront Required Scopes
All permissions except 'Gates' are required for the Hydrogen Storefront API.
Ensure unauthenticated_read_customer_tags
is selected for the Customer Accounts experience.
Steps to Configure Hydrogen Storefront Permissions:
- Navigate to Shopify Admin > Sales Channels > Hydrogen.
- Click on your Hydrogen Storefront.
- Click Storefront Settings.
- Click Storefront API or Customer Account API to configure the permissions.
Environment Variables
To edit your Hydrogen Storefront environment variables, follow these steps:
- Navigate to Shopify Admin > Sales Channels > Hydrogen.
- Click on your Hydrogen Storefront.
- Click Storefront Settings.
- Click Environments and Variables.
GTM Setup
To add your Google Tag Manager (GTM) container ID to your Hydrogen Storefront, follow these steps:
- Navigate to Shopify Admin > Sales Channels > Hydrogen.
- Click on your Hydrogen Storefront.
- Click Storefront Settings.
- Click Environments and Variables.
- Click Add Variable:
- Key:
PUBLIC_GTM_CONTAINER_ID
- Value:
GTM-XXXXXXX
- Environments: Select all available.
- Key:
- Click Save.
Redirecting Traffic to Your Hydrogen Storefront
When your Hydrogen store is ready to be set as the primary, public storefront, you'll need to redirect traffic from the online store to your Hydrogen storefront.
Steps to Set Hydrogen Store as Primary:
For detailed guidance, refer to the Shopify documentation:
Redirect traffic to the Hydrogen storefront
This will ensure your Hydrogen storefront becomes the main entry point for your customers.