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

@plugwright/auth-authme

v3.0.0

Published

Reference plugwright authentication plugin for an AuthMe-style login/register flow

Readme

@plugwright/auth-authme

Reference plugwright authentication plugin for a server running AuthMe, or anything else that asks for a password in chat.

On every bot connection — the first bot of a test, a second bot from createPlayer(), and every player.rejoin() — it waits for the server's prompt and answers it. Registration is followed through to the login it triggers, because a command sent between the two is still rejected as unauthenticated.

Microsoft (online-mode) accounts go through the same handshake by default — whether AuthMe still puts up a login wall for a premium account is a server-side setting, not something this plugin assumes. Set skipOnMicrosoftAccount if you've confirmed yours doesn't.

Usage

environments {
    create("staging", ExternalMode) {
        accounts {
            autoRegister {
                usernamePattern.set("pw_%04d")
                password.set(secret.env("BOT_PASSWORD"))
                max.set(4)
            }
        }
        plugins {
            npm("@plugwright/auth-authme") {
                options["loginCommand"] = "/log"
            }
        }
    }
}

The same block works on a LocalMode environment. A local server running AuthMe puts up the same wall as a remote one.

Which command it sends

The server decides, not the account. account.justCreated is a hint from the account pool, and it is wrong every time a pool account outlives the run that created it — that is the second run against any stand. So the plugin waits for whichever of a register prompt, a login prompt, or a session-resume message arrives, and acts on that. The register pattern is tested first, since AuthMe's register prompt mentions the password too and would otherwise look like a login prompt.

A reconnect within AuthMe's own session timeout gets no prompt at all — AuthMe already considers the account logged in and says so via sessionResumedPattern instead. The plugin stops there without sending a command. Nothing matching within timeoutMs is treated as a genuine failure, not a stale session.

Options

| Option | Default | Meaning | |---|---|---| | loginCommand | /login | Sent with the password appended | | registerCommand | /register | Sent with the password twice | | loginPromptPattern | log ?in\|password | Regex identifying the login prompt | | registerPromptPattern | regist | Regex identifying the register prompt | | successPattern | success\|welcome\|logged in\|authenticat | Regex confirming the command was accepted | | authenticatedPattern | logged in\|authenticat | Narrower regex confirming the player is actually authenticated | | sessionResumedPattern | Session Reconnection | Regex confirming AuthMe resumed the session on its own, no prompt needed | | timeoutMs | 15000 | How long to wait for each prompt or confirmation | | password | — | Fallback password for accounts that carry none | | skipOnMicrosoftAccount | false | Skip the handshake entirely for microsoft accounts |

All patterns are matched case-insensitively, and only against messages that arrived after the step they belong to. A greeting containing the word "welcome" would otherwise pass for a login confirmation, and the test would start before the player could run a single command.

password covers accounts an environment invents rather than leases: LocalMode hands every test a throwaway Test_<uuid> with no password of its own. Plugin options travel as plain strings, so use it only where the password protects nothing — a local server that is deleted after the run. Anywhere else, put the accounts in accounts { }, where the password stays a secret reference until the runner reads it.

microsoft accounts (accounts { microsoft { ... } }) carry no password of their own either — mineflayer authenticates them itself — so if your server still prompts them, they need password too. Set skipOnMicrosoftAccount = true only once you've confirmed your server lets premium accounts straight through without one.

Preflight test

A preflight test ships with the plugin and runs before any user spec. The handshake above already throws on the first connection if it fails, so the test mostly exists to put a named failure at the top of the report instead of a stack trace buried in someone else's test.

Server-side settings that matter

A stock AuthMe config is tuned for humans and rejects a test suite in three specific ways. On a disposable local server:

settings:
    registration:
        dialog:
            preJoin: { enable: false }    # bots cannot answer a dialog
            postJoin: { enable: false }
    restrictions:
        maxRegPerIp: 0                    # every test registers from 127.0.0.1
Protection:
    enableAntiBot: false                  # a test suite looks exactly like a bot attack

The example_plugin in this repository writes that file through writeFiles { } and runs its full suite against it.

License

MIT