Git Product home page Git Product logo

gatsby-starter-stripe-storefront's Introduction

Gatsby Starter Stripe Storefront

WARNING!!!

This only works for Stripe's new Checkout API. If you create your products with "Orders" this will not work

This is a starter built off of gatsby-theme-stripe-storefront

Usage

The idea is to be able to quickly set up a bare-minimum e-commerce page using your Stripe API keys.

You can get your Stripe API keys here:

https://dashboard.stripe.com/apikeys

Be sure to set up environment variables at the root of the project so you can hide your secret keys:

.env.development

STRIPE_API_SECRET=SECRET_KEY_HERE
STRIPE_API_PUBLIC=PUBLIC_KEY_HERE

To get your Stripe products running to display in this starter, you need to pass your Stripe API Public key to the gatsby-config.js file:

require('dotenv').config({
  path: `.env.${process.env.NODE_ENV}`,
})

module.exports = {
  plugins: [
    {
      resolve: 'gatsby-theme-stripe-storefront',
      options: {
        stripePublicKey: process.env.STRIPE_API_PUBLIC,
      },
    },
  ],
}

We intentionally avoid passing the stripeSecretKey in Gatsby config for security reasons.

Your secret key will float down to the gatsby-node file in gatsby-theme-stripe-storefront

Styling

You probably want to change the main colors of the storefront. You can do so by updating the theme object:

src/gatsby-plugin-theme-ui/index.js

import merge from "deepmerge";
import baseTheme from "gatsby-theme-stripe-storefront/src/gatsby-plugin-theme-ui";

export default merge(baseTheme, {
  colors: {
    primary: "coral",
    primaryText: "black",
    secondary: "skyblue"
  }
});

Change the primary, secondary and primaryText values to be the colors that you desire.

Logo

You can replace the logo with an image of your choice. There is a logo component that takes in an imported image. You can use extended shadowing to accomplish this.

Change logo.js to look like the following:

src/gatsby-theme-stripe-storefront/components/logo.js

import Logo from 'gatsby-theme-stripe-storefront/src/components/logo'
import image from 'path/to/image'

export default props => <Logo {...props} logo={image} />

Copy

To change the storefront copy, there is strings.json file where you can change the string value for storefront

src/strings.json

{
  "storefront": "Change this copy in the strings.json file!"
}

gatsby-starter-stripe-storefront's People

Contributors

dayhaysoos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.