npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

shopify-webhook-commander

v0.2.1

Published

Set up Shopify webhook subscriptions from the command line

Downloads

4

Readme

Shopify Webhook Commander

Installation

🚫 This package is under active development; installer beware.

$ npm i -g shopify-webhook-commander

Example

$ shopify-webhook-commander config:set
  > Shop (with .myshopify.com): tbeseda.myshopify.com
  > Password: ****************

$ shopify-webhook-commander webhook:create
  > Webhook topic: ORDERS_CREATE
  > Callback URL: https://ingest.my-app.com/
  Created gid://shopify/WebhookSubscription/1021513859211 for "tbeseda"

$ shopify-webhook-commander webhook:list
  Webhooks for "tbeseda"
    Topic          Endpoint                   ID
    ────────────── ────────────────────────── ───────────────────────────────────────────────
    SHOP_UPDATE    https://ingest.my-app.com/ gid://shopify/WebhookSubscription/1021513859211

$ shopify-webhook-commander webhook:delete
  > Webhook id to delete: gid://shopify/WebhookSubscription/1021513859211
  Deleted gid://shopify/WebhookSubscription/1021513859211 from "tbeseda"

Shopify Webhook Topics

This tool uses the Shopify Admin GraphQL API. Webhook subscription topics should be of type WebhookSubscriptionTopic

Note about auth tokens

This tool uses a single token to authenticate; this is easiest with a Shopify "Private" Admin App. Set the config secret to the private app password. There is no OAuth flow to help with "Custom" Partner apps. In theory, you can instead provide an accessToken acquired from a Custom app's authentication flow. I haven't tested this. shopify-webhook-commander doesn't really help for "Public" apps that typically manage webhooks for each shop install programatically.

Roadmap

  1. tests 😬
  2. replace Apollo client with a slimmer GQL lib
  3. integrate @shopify/shopify-api types -- gotta get rid of those any types
  4. webhooks:update command
  5. autocomplete webhook topics
  6. auth loop for custom apps

oclif Generated Docs:

The section below is auto-generated by oclif upon package release.

shopify-webhook-commander

Set up Shopify webhook subscriptions from the command line

oclif Version Downloads/week License

Usage

$ npm install -g shopify-webhook-commander
$ shopify-webhook-commander COMMAND
running command...
$ shopify-webhook-commander (-v|--version|version)
shopify-webhook-commander/0.2.1 darwin-arm64 node-v16.4.1
$ shopify-webhook-commander --help [COMMAND]
USAGE
  $ shopify-webhook-commander COMMAND
...

Commands

shopify-webhook-commander config:reveal

print current Shopify config

USAGE
  $ shopify-webhook-commander config:reveal

OPTIONS
  -h, --help  show CLI help
  -y, --yes   agree to reveal

See code: src/commands/config/reveal.ts

shopify-webhook-commander config:set

set Shopify credentials config

USAGE
  $ shopify-webhook-commander config:set

OPTIONS
  -h, --help       show CLI help
  --secret=secret
  --shop=shop

See code: src/commands/config/set.ts

shopify-webhook-commander config:unset

remove Shopify config

USAGE
  $ shopify-webhook-commander config:unset

OPTIONS
  -h, --help  show CLI help

See code: src/commands/config/unset.ts

shopify-webhook-commander help [COMMAND]

display help for shopify-webhook-commander

USAGE
  $ shopify-webhook-commander help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

shopify-webhook-commander webhooks:create

create a webhook subscription

USAGE
  $ shopify-webhook-commander webhooks:create

OPTIONS
  -h, --help                 show CLI help
  --callbackUrl=callbackUrl
  --topic=topic

See code: src/commands/webhooks/create.ts

shopify-webhook-commander webhooks:delete

delete a webhook given a resource id

USAGE
  $ shopify-webhook-commander webhooks:delete

OPTIONS
  -h, --help  show CLI help
  --id=id

See code: src/commands/webhooks/delete.ts

shopify-webhook-commander webhooks:list

list existing shop webhook subscriptions

USAGE
  $ shopify-webhook-commander webhooks:list

OPTIONS
  -h, --help  show CLI help

See code: src/commands/webhooks/list.ts