# shopify-verify-app-proxy-middleware

> Express middleware to verify requests coming from your shopify app proxy

Latest version **0.0.2** (published 2022-09-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install shopify-verify-app-proxy-middleware
pnpm add shopify-verify-app-proxy-middleware
yarn add shopify-verify-app-proxy-middleware
bun add shopify-verify-app-proxy-middleware
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2022-09-21 |
| First published | 2022-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | mroffersen |
| Keywords | shopify, app proxy, middleware, verify, express, app, helper |

## Links

- npm: https://www.npmjs.com/package/shopify-verify-app-proxy-middleware
- Repository: https://github.com/JakobOffersen/shopify-verify-app-proxy-middleware
- Issues: https://github.com/JakobOffersen/shopify-verify-app-proxy-middleware/issues
- npm.io page: https://npm.io/package/shopify-verify-app-proxy-middleware

## Dependencies (2)

- [express](https://npm.io/package/express.md) ^4.18.1
- [shopify-verify-app-proxy](https://npm.io/package/shopify-verify-app-proxy.md) ^0.0.2

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2022-09-21
- 0.0.1 — 2022-09-21

## README

# shopify-verify-app-proxy-middleware
Express middleware to verify that requests comes from your shopify app proxy.

## Installation
```
npm install shopify-verify-app-proxy-middleware
```

## Details
Shopify App Proxies allow you to verify that a request comes from your theme extension (e.g. app-block or embedded app-block)-
The app proxy intercepts the request from the theme extension and extends the query with the following properties
```json
{
  "extra": ["1", "2"],
  "shop": "shop-name.myshopify.com",
  "logged_in_customer_id" : 1,
  "path_prefix": "/apps/your-prefix",
  "timestamp": "1317327555",
  "signature": "signature using your SHOPIFY_API_SECRET as shared secret",
}
```
This package helps you verify the signature of the query in a middleware

## Example
``` ts
import express from "express"
import { createVerifyAppProxyMiddleware } from "shopify-verify-app-proxy-middleware"

const { SHOPIFY_API_SECRET } = process.env

const app = express()
const verifyAppProxyMiddleware = createVerifyAppProxyMiddleware(SHOPIFY_API_SECRET)

app.get("/route/used/by/your/storefront/theme-extension", verifyAppProxyMiddleware, async (req, res) => {
  // this request handler will only be hit if the incoming request is verified
})
```

---
_Source: https://npm.io/package/shopify-verify-app-proxy-middleware · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
