oauthshopifygatsbygatsby-plugin

Gatsby-source-shopify authentication issue


I am trying to create a gatsby site that uses shopify.

Following the gatsby docs here I noticed that there was no "private" apps.

According to the shopify docs here private apps have been deprecated and now they are called custom apps.

This is the part I get a bit confused. Along with this is a change in auth. Before, using the gatsby-source-shopify plugin, I was able to add a store url and private app password into the gatsby-config and then I could work with the shopify storefront API. But, now there is not single password with custom apps.

Because this deprecation (from shopify) happened 2 months ago it seems like Gatsby documentation needs to be updated as well as the gatsby-source-shopify plugin.

Some general direction and help on how to get a gatsby site to authenticate (which now uses OAuth) with the shopify storefront API would be great.


Solution

  • I understand this is relatively new.

    To help guide others, here is what I have found.

    It seems that Shopify is moving away from the Storefront Checkout API to the Storefront Cart API. One of these steps is to move from private apps to custom apps in the shopify admin. My understanding is that this is a move towards unauthenticated access to make the process easier.

    And the gatsby-source-shopify plugin has not been updated to reflect this move.

    I think that you could build out your own shopify service classes and connection in gatsby if you wanted. However, I would recommend NextJS to do so.

    I have not found a starter template other than this one. My only hesitation with this starter is that it uses Astro. I'm not super familiar with it and I want the ability to do something more from the ground up. (I think a good starter, if someone finds one, would be one that just includes basic Gatsby or NextJS or whatever framework, and then the basic queries and services that allow you to interact with the shopify admin. Get products. Checkout. Etc...)