auth-shop-ify
v1.0.0
Published
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.
Downloads
1
Readme
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
Clone this repository to your local machine:
git clone https://github.com/ShashwotBhattarai/shopify-auth.git
Install the project dependencies by running the following command in the project directory:
npm install
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
- List the redirect url in your app setup.
Usage
Start the application by running:
node index.js
Your application will be running on
http://localhost:3000
.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.
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.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.The app will return a JSON response with the access token and store name.