Coder Social home page Coder Social logo

shopify-ca-poc's Introduction

Shopify Customer Accounts API PoC

Proof-of-concept for accessing the Shopify customer accounts API with a focus on the authorization flow.

Set Up & Run

  1. npm i
  2. nano .env and add at least:
    • APP_URL=https://<ngrok identifier>.ngrok-free.app
    • SHOPIFY_SHOP_ID=1234567890
    • SHOPIFY_CUSTOMER_ACCOUNT_API_CONFIDENTIAL_CLIENT_ID=shp_...
    • SHOPIFY_CUSTOMER_ACCOUNT_API_CONFIDENTIAL_CLIENT_SECRET=...
    • for all config options & envs, see config/schema.js
  3. npm start
  4. Open $APP_URL/login to start the authorization process

Available Routes

  • /login - redirects to Shopify login
  • /loggedIn - authorization callback after successful login
  • /profile - some basic info from the Customer Accounts API
  • /cart - current cart contents, PoC on how Storefront API access works
  • /cart/add/<product variant ID> - adds a product to the cart
  • /checkout - redirects to the Shopify checkout page (or start page if cart is empty)
  • /loggedOut - Shopify logout callback - not implemented

Known issues

  1. Tokens are only stored per run time, meaning you'll have to go via /login after each restart, including nodemon restarts.

shopify-ca-poc's People

Contributors

rekhyt 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.