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

@bauer-group/console-security-banner-react

v0.3.0

Published

React 19 component & hook for the BAUER GROUP Console Security Banner — warns end users about Self-XSS scams in the browser console. Local-bundled (zero requests) by default, optional CDN mode.

Readme

@bauer-group/console-security-banner-react

React 19 component & hook for the BAUER GROUP Console Security Banner — a lean widget that warns end users about Self-XSS scams ("paste this into the console to unlock…") directly in the browser console, and only when DevTools are actually opened.

  • Local by default — detection logic, render and all 22 locales are bundled into your app. Zero network requests, works offline / air-gapped.
  • Optional CDN mode — inject the loader from widgets.professional-hosting.com instead (smaller bundle).
  • SSR-safe, idempotent, React 19 Strict-Mode-safe, ships its own types and a "use client" directive for the Next.js App Router.

npm License: MIT


Install

npm i @bauer-group/console-security-banner-react

react (^19) is a peer dependency.

Quick start

Mount the component once, near the root of your app.

import { ConsoleSecurityBanner } from '@bauer-group/console-security-banner-react';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="de">
      <body>
        <ConsoleSecurityBanner />
        {children}
      </body>
    </html>
  );
}

The component renders nothing — it just arms the banner. The language follows <html lang>, then navigator.languages, then English.

Next.js (App Router)

The package is already marked "use client", so you can drop it straight into a Server Component (e.g. app/layout.tsx) without adding your own directive.

Hook form

For programmatic control (custom layouts, conditional enablement):

'use client';
import { useConsoleSecurityBanner } from '@bauer-group/console-security-banner-react';

export function Providers({ children }: { children: React.ReactNode }) {
  useConsoleSecurityBanner({ lang: 'de' });
  return <>{children}</>;
}

Modes

<ConsoleSecurityBanner />                 {/* local (default) — zero requests */}
<ConsoleSecurityBanner mode="cdn" />      {/* inject the loader from the CDN  */}
  • local bundles the widget into your app — nothing is fetched at runtime.
  • cdn injects …/console-banner/v1/loader.min.js from the CDN. Pin its Subresource-Integrity hash (from the published integrity.json) for supply-chain hardening.

Props / options

| Prop | Type | Default | Description | | ----------- | ------------------ | ------------------------------------------------------------ | ----------------------------------------------------------------------------------- | | mode | 'local' \| 'cdn' | 'local' | Bundle locally (zero requests) or load the CDN loader script. | | lang | string | auto | Force a locale (e.g. 'de'); otherwise auto-detected. | | disabled | boolean | false | Disable entirely (e.g. per environment). | | nonce | string | — | CSP nonce for the injected script (CDN mode). | | cdnUrl | string | https://widgets.professional-hosting.com/console-banner/v1 | Override the CDN base (CDN mode). | | integrity | string | — | SRI hash for the loader script (CDN mode). | | probe | boolean | false | Strict-security opt-in: also detect undocked DevTools (logs one console value). |

The hook accepts the same options object.

Notes

  • SSR: the effect is a no-op on the server; nothing renders until hydration.
  • CSP: in CDN mode pass nonce so the injected script satisfies a strict script-src 'nonce-…' policy. In local mode there is no injected script.
  • Idempotent: mounting more than one instance arms the banner once.

License

MIT © BAUER GROUP. Part of the Console Security Banner project (the CDN widget lives in the same repository).