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

@fullstackhouse/open-mercato-demo-auth

v0.3.0

Published

Dev-only login form prefill + auto-submit widget for Open Mercato applications

Downloads

1,061

Readme

@fullstackhouse/open-mercato-demo-auth

Auto-fill and auto-submit the login form on your dev and preview deployments so you don't have to retype admin / secret a hundred times a day.

Dev only. The server reads DEMO_AUTH_LOGIN_EMAIL / DEMO_AUTH_LOGIN_PASSWORD at request time and inlines them into the HTML. Leave both unset in production — that's the only safety gate, and it's by design.

Install

npm install --save-dev @fullstackhouse/open-mercato-demo-auth
# or
yarn add -D @fullstackhouse/open-mercato-demo-auth

Usage

Drop both components into your root layout. The server component injects the credentials into the HTML; the client component watches for the login form, fills it in, and submits it:

// app/layout.tsx
import { DemoAuthScript, DemoAuthAutofill } from '@fullstackhouse/open-mercato-demo-auth'

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html>
      <head>
        <DemoAuthScript />
      </head>
      <body>
        <DemoAuthAutofill />
        {children}
      </body>
    </html>
  )
}

Both components short-circuit to nothing when the env vars aren't set, so they're safe to always mount.

Env vars

[email protected]
DEMO_AUTH_LOGIN_PASSWORD=secret
  • With both set, the form auto-fills and auto-submits.
  • With only the email set, just the email field is prefilled — no submit.
  • With neither set, nothing runs. Use this on prod.

Kubernetes example

Put the two keys in the dev/preview ConfigMap and leave them out of prod:

# configmap-dev.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: my-app-config
data:
  DEMO_AUTH_LOGIN_EMAIL: [email protected]
  DEMO_AUTH_LOGIN_PASSWORD: secret
  # ... other env vars
# configmap-prod.yaml — same ConfigMap, without the two demo keys
apiVersion: v1
kind: ConfigMap
metadata:
  name: my-app-config
data:
  # ... other env vars, no DEMO_AUTH_* here

Why not NEXT_PUBLIC_*?

NEXT_PUBLIC_* values are inlined into the client bundle at build time. If you ship a single Docker image across dev/preview/prod — the common pattern — any value you bake in for dev leaks to prod. This package reads ordinary server-side env vars at request time and writes them into the HTML that's served, so one image + per-environment ConfigMaps gives you per-environment behavior.

Form shape it targets

DemoAuthAutofill looks for:

<form data-auth-ready="1">
  <input name="email" />
  <input name="password" />
</form>

Open Mercato's core login form already exposes data-auth-ready="1" once hydrated; this package was designed against that, but any form following the same convention works.

Security

  • The JSON payload is HTML-escaped (<, >, &, U+2028, U+2029) before being inlined into the <script> tag. Injection-hardened against adversarial values, but don't pipe untrusted input into these env vars — they execute on every page load.
  • There is deliberately no NODE_ENV === 'production' kill-switch. Many setups (including Open Mercato) set NODE_ENV=production on every environment, which would defeat the purpose. Keep prod safe by leaving the env vars unset there — the server component emits nothing and the client component short-circuits.
  • Zero runtime dependencies.

Migrating from 0.2.x

  1. Delete any src/modules/demo_auth/ re-export shim you created.
  2. Remove { id: 'demo_auth', from: '@app' | '@fullstackhouse/open-mercato-demo-auth' } from src/modules.ts.
  3. Add <DemoAuthAutofill /> to your root layout next to <DemoAuthScript />.

The env-var names (DEMO_AUTH_LOGIN_EMAIL / DEMO_AUTH_LOGIN_PASSWORD) are unchanged.

Peer dependencies

  • react >= 18
  • react-dom >= 18

License

MIT — Full Stack House.