# verify-shopify-webhook

> Verify the authenticity of an incoming Shopify webhook quickly and easily. Requires a raw body (shopify requirement), but parses to JSON for you.

Latest version **1.0.5** (published 2020-10-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install verify-shopify-webhook
pnpm add verify-shopify-webhook
yarn add verify-shopify-webhook
bun add verify-shopify-webhook
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2020-10-03 |
| First published | 2020-10-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Derek Kershner |
| Maintainers | dkershner6 |
| Keywords | shopify, webhook, verify, hmac |

## Links

- npm: https://www.npmjs.com/package/verify-shopify-webhook
- Repository: https://github.com/dkershner6/shopify-verify-webhook
- Homepage: https://github.com/dkershner6/shopify-verify-webhook#readme
- Issues: https://github.com/dkershner6/shopify-verify-webhook/issues
- npm.io page: https://npm.io/package/verify-shopify-webhook

## Dependencies (1)

- [raw-body](https://npm.io/package/raw-body.md) ^2.4.1

## Recent versions

- 1.0.5 (latest) — 2020-10-03

## README

# verify-shopify-webhook

Verify shopify webhook using any API solution, make your own middleware easily.
Requires a raw body (shopify requirement), but parses to JSON for you.
Only dependency is on `raw-body`, this is a very tiny library.

## Installation

`npm i verify-shopify-webhook`

## Usage

```typescript
import verifyWebhook from 'verify-shopify-webhook';

const middleware = async (req, res, next) => {
    const shopifySecret = process.env.SHOPIFY_SECRET;

    const { verified, topic, domain, body } = await verifyWebhook(
        req,
        shopifySecret
    );

    if (!verified) {
        return res.status(403).send();
    }

    req.body = body;

    return next();
};
```

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