Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
cypress init Sep 27, 2019
lib init Sep 27, 2019
src modifying to include app insights Oct 4, 2019
static init Sep 27, 2019
tests init Sep 27, 2019
.babelrc
.eslintrc
.gitignore modifying to include app insights Oct 4, 2019
.prettierignore init Sep 27, 2019
.travis.yml
LICENSE init Sep 27, 2019
README.md working on the readme's Oct 4, 2019
cypress.json init Sep 27, 2019
gatsby-browser.js init Sep 27, 2019
gatsby-config.js modifying to include app insights Oct 4, 2019
gatsby-node.js init Sep 27, 2019
gatsby-ssr.js init Sep 27, 2019
jest.config.js init Sep 27, 2019
lint-staged.config.js init Sep 27, 2019
package-lock.json modifying to include app insights Oct 4, 2019
package.json modifying to include app insights Oct 4, 2019
prettier.config.js init Sep 27, 2019
wrap-with-provider.js init Sep 27, 2019

README.md

AppInsights with React and Gatsby

The is a demo application showing how to integrate Azure AppInsights into a Gastby website, using the Gatsby eCommerce Starter template (refer below for more information on the starter kit and how to configure it).

Configuring AppInsights

To configure AppInsights you'll need to create a resource in the portal and copy the instrumentation key. Once you have the instrumentation key create a .env.development file to setup the environment variable that Gatsby will look for:

APPINSIGHTS_KEY=<instrumentation key here>

Running in development

npm run develop

Observing AppInsights

As you navigate around you're page views will start being tracked by AppInsights and you'll be able to see them in the logs. Here's a simple query to see page views:

pageViews
| limit 50

More Information

You can learn more about integrating AppInsights on my blog.


Gatsby Starter eCommerce

Gatsby starter for creating an eCommerce site using Moltin eCommerce Api.

This starter adapts an existing NextJS eCommerce starter for GatsbyJS.

Demo: https://parmsang.github.io/gatsby-starter-ecommerce/

This starter originally used Gatsby v1 and has now been updated to v2. The original version can be found in branch "gatsby-v1".

Warning

This starter is currently work in progress

Getting started

Install this starter (assuming Gatsby is installed) by running from your CLI:

gatsby new gatsby-store https://github.com/parmsang/gatsby-starter-ecommerce

Running in development

npm run develop

Additional Setup

Both a moltin and Stripe account are needed for this store to run successfully.

Create a .env.development and .env.production file at the project root with your moltin client_id and Stripe test publishable key.

MOLTIN_CLIENT_ID=
STRIPE_PUBLISHABLE_KEY=

Features

  • Moltin eCommerce API
  • React 16
  • PWA (includes manifest.webmanifest & offline support)
  • Eslint & Prettier
  • Styled Components
  • Google Analytics - (you enter the tracking-id)
  • Semantic-UI
  • Authentication via Moltin (Login and Register)
  • Stripe checkout
You can’t perform that action at this time.