Skip to content

Developer-DAO/shopify-crypto-wallet

Repository files navigation

Shopify MetaMask (or any crypto wallet?) Integration

More details here

Project will consist of 3 parts:

  • NextJS frontend:
    • An admin dashboard where shop owner configures which contract holder is eligible for discounts/custom merch
  • NextJS backend:
    • Server that stores the data
    • Dynamically create promo codes for discounts using Shopify API (?) - need to do some research on that
  • A widget that
    • connects with crypto wallet
    • talks to server to verify if user is eligible for discounts/custom merch
    • fetches promo code from server and applies it to the user's cart

Requirements

Development

  • Clone the project and run npm install
  • Create .env from .env.example
  • Add SHOPIFY_API_KEY=<your API key> from your Shopify App settings
  • Add SHOPIFY_API_SECRET=<your API secret>
  • Add SHOP=<your shop>.myshopify.com
  • SCOPES will be updated, for now just leave them as in the example
  • Start NGROK and replace HOST with your NGROK URL

In your Shopify App settings:

You will need to update it every time you change NGROK URL

  • npm run dev
  • Click Select store under Test your app in Shopify App settings
  • This should prompt you to install the app in your development store and open it in an admin dashboard. Common error is The redirect URI is not whitelisted, in that case you need to update NGROK URL in Allowed redirection URL(s)

Theme App Extension

Example of a theme app extension: https://github.com/Shopify/theme-extension-getting-started

WIP: https://www.loom.com/share/9cb9caccd1494387937ae0ce6b614d66