1.0.0 • Published 7 months ago

auth-shop-ify v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

Shopify OAuth Express App

This is a simple Express.js application that implements the Shopify OAuth flow to allow merchants to install your app. It's designed to be used as a starting point for building Shopify apps using Node.js and Express.

Prerequisites

Before you begin, make sure you have the following:

  • Node.js installed on your development machine.
  • A Shopify Partner account and a development store to test your app.

Installation

  1. Clone this repository to your local machine:

    git clone https://github.com/ShashwotBhattarai/shopify-auth.git
  2. Install the project dependencies by running the following command in the project directory:

    npm install
  3. Create a .env file in the project directory and add your Shopify API credentials:

    SHOPIFY_API_KEY=your-api-key
    SHOPIFY_API_SECRET=your-api-secret
    APP_URL=your-app-url

Configuration

  1. List the redirect url in your app setup.

Usage

  1. Start the application by running:

    node index.js
  2. Your application will be running on http://localhost:3000.

  3. You need to create an app in your Shopify store. After setting up the callback URLs in the app settings, you can install it into your store.

  4. After the installation, you will be redirected to the Shopify OAuth authorization screen. After the merchant approves your app, they will be redirected back to your app's /shopify/callback endpoint.

  5. Your app will receive the code parameter in the callback, which can be used to obtain an access token from Shopify. The access token can then be used to make API requests on behalf of the store.

  6. The app will return a JSON response with the access token and store name.