The project was forked from the reactHooks-redux-js-buy repository produced by Shopify.
An example using js-buy-sdk built with React and Redux. This project was bootstrapped with Create React App.
You will need the following things properly installed on your computer.
git clone https://github.com/Shopify/storefront-api-examples.git
this repositorycd storefront-api-examples
cd reactHooks-redux-js-buy
yarn install
If you would like to connect your store to this example, open up src/redux/ducks/shopify/index.js
and update the domain
and storefrontAccessToken
at the top of the page:
const client = Client.buildClient({
storefrontAccessToken: "your-storefront-access-token",
domain: "your-shop-name.myshopify.com",
})
To fetch a collection, uncomment the collection functions in src/components/App.js
, and in src/redux/ducks/shopify/index.js
function getCollection()
fetchCollection()
React-icons are used as a dependency, but could easily be changed to something else.
Start a local server:
yarn start
- Visit your app at http://localhost:3000.
For help on setting up the repo locally, building, testing, and contributing please see CONTRIBUTING.md.
All developers who wish to contribute through code or issues, take a look at the CODE_OF_CONDUCT.md.
MIT, see LICENSE for details.