Coder Social home page Coder Social logo

bc-grapql's Introduction

Why?

Boilerplate commerce store that can be used with BigCommerce GraphQl API, to quickly make a shopping experience.

What does this application do?

The application is fetching products from a demo store and has complete checkout flow using BigCommerce checkout SDK.

Contributing

George FitzGibbons, Patrick Williams, Ashley McKemie

Running the project

To get started you will need to have a BigCommerce Store.

You will need to have +v10 node.

You will need to generate API keys for the checkout SDK, these keys need to have full permissions

You will need to generate an GraphQl API key as well to fetch products https://developer.bigcommerce.com/api-docs/storefront/graphql/graphql-storefront-api-overview

GraphQL Storefront API requests are authenticated with tokens sent via the HTTP Authorization header:

curl 'https://www.{bigcommerce_storefront_domain}.com/graphql'\
  # ...
  -H 'Authorization: Bearer {token}'\
  # ...
Creating a Token
JWT tokens for authenticating cross-origin requests to the Storefront API can be created using the Storefront API Token endpoint:

POST https://api.bigcommerce.com/stores/{store_hash}/v3/storefront/api-token

{
  "channel_id": 1,            // int (only ID 1 currently accepted)
  "expires_at": 1602288000,   // double utc unix timestamp (required)
  "allowed_cors_origins": [   // array (accepts 1 origin currently)
    "https://example.com"
  ]
}

Create a .env file in the root directory and add the following with your secrets:

BC_TOKEN
BC_STOREFRONT_TOKEN
BC_STOREFRONT_CLIENT

Now you're ready to go!

npm install

To run locally

npm run dev

bc-grapql's People

Contributors

gje4 avatar

Watchers

 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.