Setting up a Shopify dev store

Setting up the store

  1. Log into the Shopify parter website.
  2. On the left-hand side bar, head to Stores.
  3. Click Add store.
  4. Follow the prompts.

Connecting to your store

Before this, ensure that you have added a new product.

$ npx create-next-app shopify-storefront -e with-typescript # ... creates storefront $ cd shopify-storefront $ touch utils/shopify.ts

In utils/shopify.ts, add the following:

import Client from "shopify-buy" export const client = Client.buildClient({ storefrontAccessToken: process.env.SHOPIFY_STORE_FRONT_ACCESS_TOKEN, domain: process.env.SHOPIFY_STORE_DOMAIN, })

At this stage, you will need to create an app on your store admin page.

Within the app, set all Storefront API permissions.

Resources and further reading