![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@shopify/shopify-app-express
Advanced tools
Shopify Express Middleware - to simplify the building of Shopify Apps with Express
@shopify/shopify-app-express
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.
To follow these usage guides, you will need to:
To install this package, you can run this on your terminal:
# Create your project folder
mkdir /my/project/path
# Set up a new yarn project
yarn init .
# You can use your preferred Node package manager
yarn add @shopify/shopify-app-express
Then, you can import the package in your app by creating an index.js
file containing:
const express = require('express');
const {shopifyApp} = require('@shopify/shopify-app-express');
const PORT = 8080;
const shopify = shopifyApp({
api: {
apiKey: 'ApiKeyFromPartnersDashboard',
apiSecretKey: 'ApiSecretKeyFromPartnersDashboard',
scopes: ['your_scopes'],
hostScheme: 'http',
hostName: `localhost:${PORT}`,
},
auth: {
path: '/api/auth',
callbackPath: '/api/auth/callback',
},
webhooks: {
path: '/api/webhooks',
},
});
const app = express();
app.get(shopify.config.auth.path, shopify.auth.begin());
app.get(
shopify.config.auth.callbackPath,
shopify.auth.callback(),
shopify.redirectToShopifyOrAppRoot(),
);
app.post(
shopify.config.webhooks.path,
shopify.processWebhooks({webhookHandlers}),
);
app.get('/', shopify.ensureInstalledOnShop(), (req, res) => {
res.send('Hello world!');
});
app.listen(PORT, () => console.log('Server started'));
Once you set the appropriate configuration values, you can then run your Express app as usual, for instance using:
node ./index.js
To load your app within the Shopify Admin app, you need to:
http://localhost:8080
http://localhost:8080/api/auth/callback
in that same pageNow that your app is up and running, you can learn more about the shopifyApp
object in the reference docs.
FAQs
Shopify Express Middleware - to simplify the building of Shopify Apps with Express
The npm package @shopify/shopify-app-express receives a total of 5,986 weekly downloads. As such, @shopify/shopify-app-express popularity was classified as popular.
We found that @shopify/shopify-app-express demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.