shopify-auth-node
v1.2.0
Published
package to handle shopify authentication with one function call
Downloads
3
Readme
Shopify Auth Node
NodeJS + Express authentication handler for public shopify apps that:
- Provides the path for Shopify callbacks during installation.
- Validates & Handles authentication automatically.
- Provides accessToken & shop name in the callback after successful authentication.
- Provides a re-login path
- Provides a path for GDPR handler
Installation
Use the package manager npm to install Shopify Auth Node.
npm install shopify-auth-node
Usage
const shopifyAuthNode = require('shopify-auth-node');
const express = require('express');
const app = express();
shopifyAuthNode.bootstrap({
app, // express server instance
shopifyAppScopes: 'read_script_tags,write_script_tags', // etc
shopifyApiKey: 'your_api_key',
shopifyApiSecret: 'your_api_secret',
shopifyAppUri: 'your_app_url_which_hosts_this_code',
successCallBack: ({ accessToken, shop, res }) => yourHandler()
})
Setting on Shopify App Setup Page
- Set your app URL to
https://your_app_url.xyz/shopify
- Set your GDPR URL's to:
https:///your_app_url.xyz/shopify/webhooks/customers/data_request
https://your_app_url.xyz/shopify/webhooks/customers/redact
https://your_app_url.xyz/shopify/webhooks/shop/redact
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.