Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopify/shopify-app-express

Package Overview
Dependencies
Maintainers
18
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/shopify-app-express

Shopify Express Middleware - to simplify the building of Shopify Apps with Express

  • 1.0.0-rc2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8.7K
increased by8.43%
Maintainers
18
Weekly downloads
 
Created
Source

@shopify/shopify-app-express

License: MIT

This package makes it easy for Express.js apps to integrate with Shopify. It builds on the @shopify/shopify-api package and creates a middleware layer that allows the app to communicate with and authenticate requests from Shopify.

Note: this package will enable your app's backend to work with Shopify APIs, and by default it will behave as an embedded app. You'll need to use Shopify App Bridge in your frontend to authenticate requests to the backend.

Getting started

To install this package, you can run this on your terminal:

# You can use your preferred Node package manager
yarn add @shopify/shopify-app-express @shopify/shopify-api

Then, you can import the package in your app

import {shopifyApp} from '@shopify/shopify-app-express';
import express from 'express';

const PORT = 8080;

const shopify = shopifyApp({
  api: {
    apiKey: 'ApiKeyFromPartnersDashboard',
    apiSecretKey: 'ApiSecretKeyFromPartnersDashboard',
    scopes: ['your_scopes'],
    hostScheme: 'http',
    hostName: `localhost:${PORT}`,
  },
});

const app = express();

// Handles authenticating your app when you visit /api/auth
app.use('/api', shopify.app());

app.get('/', (req, res) => {
  res.send('Hello world!');
});

app.listen(PORT);

You can then run your Express app as usual, for instance using:

node ./index.js

And access http://localhost:8080 in your browser to view your app.

You can find all allowed configuration options for shopifyApp in the reference docs.

Keywords

FAQs

Package last updated on 20 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc