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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dropsh/plugin-oauth2

v0.5.7

Published

OAuth 2.0 authentication provider for [dropsh](https://github.com/pen-drop/dropsh), the entity-agnostic CLI for Drupal 11 JSON:API.

Readme

@dropsh/plugin-oauth2

OAuth 2.0 authentication provider for dropsh, the entity-agnostic CLI for Drupal 11 JSON:API.

Adds an OAuth2 login option to dropsh auth login. Supports three grant types against Drupal's simple_oauth module.

Install

pnpm add @dropsh/plugin-oauth2

dropsh is a peer dependency.

Usage

Register the plugin in dropsh.config.js with non-secret connection parameters only. Secrets (client secret, user password) and tokens are prompted at login and stored at ~/.config/dropsh/<host>.json (mode 0600) — never in the config file.

import { oauth2Plugin } from "@dropsh/plugin-oauth2";

export default {
  site: { base_url: "https://my-drupal.example.com", jsonapi_prefix: "/jsonapi" },
  plugins: [
    // Browser login (Authorization Code + PKCE) — recommended for humans:
    oauth2Plugin({
      type: "oauth2_authcode",
      client_id: "my-client",
      token_url: "https://my-drupal.example.com/oauth/token",
      // scope: "...", redirect_port: 7432,
    }),
  ],
};

Then:

dropsh auth login --provider oauth2_authcode
dropsh auth status

Named profiles

Every oauth2Plugin is one auth profile, identified by its id. id defaults to the grant type, but set it explicitly to run several profiles of the same grant flow side by side (e.g. two client_credentials with different scopes). Mark one profile default: true to make it the fallback when none is selected.

oauth2Plugin({ id: "session", default: true, type: "oauth2_client_credentials",
  client_id: "my-client", client_secret, token_url, scope: "some:scope" }),
oauth2Plugin({ id: "pm", type: "oauth2_client_credentials",
  client_id: "my-client", client_secret, token_url, scope: "other:scope" }),

See the dropsh README for auth use, --auth-profile, and selection precedence.

Grant types

| type | Interactive login prompts | Auto-renew (proactive + on 401) | | ----------------------------- | -------------------------------- | ------------------------------- | | oauth2_authcode | opens browser (PKCE, public client) | yes — via refresh_token | | oauth2_password | client secret + user password | yes — if client_secret in config | | oauth2_client_credentials | client secret | yes — if client_secret in config |

Config fields per grant (all accept the shared id and default):

  • oauth2_authcodeclient_id, token_url, optional scope, redirect_port
  • oauth2_passwordclient_id, token_url, username, optional scope, client_secret
  • oauth2_client_credentialsclient_id, token_url, optional scope, client_secret

client_secret and the user password may be prompted at login and are never stored on disk. For unattended runs, put client_secret in config so dropsh can re-mint tokens automatically; a purely prompted secret cannot be renewed and needs a fresh dropsh auth login when the token expires.

Required Drupal module

License

MIT OR GPL-2.0-or-later