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

@plutotcool/nuxt-password-protect

v1.8.0

Published

Plug-and-play password protection for nuxt

Readme

Nuxt Password Protect

npm version npm downloads License Nuxt

Plug-and-play password protection for nuxt.

Ths module is not meant to work for static generated websites.

✨  Release Notes

Features

  • Instant password protection with two required settings
  • Blocks access to any resources in production, including public assets.
  • Customizable authentication page

Quick Setup

Install the module to your Nuxt application with one command:

npx nuxi module add @plutotcool/nuxt-password-protect

Setup the module with a password and a secret key to sign JWT tokens (usually from environment variables):

// nuxt.config.ts

export default defineNuxtConfig({
  modules: [
    '@plutotcool/password-protect'
  ],

  passwordProtect: {
    password: process.env.PASSWORD_PROTECT,
    secret: process.env.PASSWORD_PROTECT_SECRET
  }
})

You can generate a secure secret key using the following command:

openssl rand -base64 40

That's it! You can now use Nuxt Password Protect in your Nuxt app ✨

Options

/**
 * Module options for the password protect module.
 */
export interface ModuleOptions {
  /**
   * Enable or disable the password protect module.
   * @default true
   */
  enabled?: boolean

  /**
   * The password required to access the website. Password protection will be
   * disabled if empty.
   * @default undefined
   */
  password?: string

  /**
   * A secret key used to sign the JWT token. Password protection will be
   * disabled if empty.
   * @default undefined
   */
  secret?: string

  /**
   * The expiration time for the JWT token in milliseconds.
   * @default 7 * 24 * 60 * 60 * 1000 // 7 days
   */
  expiration?: number

  /**
   * Cookie name to use for the authentication token in requests.
   * @default 'password-protect'
   */
  cookie?: string

  /**
   * Array of route patterns that must be password-protected.
   * If undefined, all routes will be protected.
   * If empty array, no route will be protected.
   * Exclusion rules takes precedence over inclusion rules.
   * @default undefined
   */
  include?: string[]

  /**
   * Array of route patterns that must be excluded from password protection.
   * If undefined, no route will be excluded from protection.
   * If empty array, no route will be excluded from protection either.
   * Exclusion rules takes precedence over inclusion rules.
   * @default undefined
   */
  exclude?: string[]

  /**
   * Configuration for the HTML template used for authentication.
   * @default undefined
   */
  template?: {
    /**
     * Language code used in the HTML root document tag.
     * @default 'en'
     */
    lang?: string

    /**
     * Meta title for the HTML document.
     * @default 'Authentication'
     */
    metaTitle?: string

    /**
     * URL or path to a logo image to display above the form, relative to nuxt
     * rootDir. If the provided file is an external url, it will be used as is.
     * If it is a local path, it will be encoded as a base64 URL.
     * @default './runtime/server/assets/logo.svg'
     */
    logo?: string

    /**
     * Public path to a favicon image used for the authentication page. The path
     * must be accessible even when not authenticated for it to work. Make sure
     * to add it to the exclude option if needed.
     * @default undefined
     */
    icon?: string

    /**
     * Mime type of the favicon image. If undefined, will be inferred from the
     * icon path.
     * @default undefined
     */
    iconType?: string

    /**
     * Title of the authentication form.
     * @default 'Authentication'
     */
    title?: string

    /**
     * Message displayed above the form input.
     * @default 'Please authenticate to access this page'
     */
    message?: string

    /**
     * Error message displayed when the authentication fails.
     * @default 'Incorrect password'
     */
    errorMessage?: string

    /**
     * Message displayed while the authentication is being processed.
     * @default 'Loading...'
     */
    loadingMessage?: string

    /**
     * Password input label.
     * @default 'Password'
     */
    inputLabel?: string

    /**
     * Submit button label.
     * @default 'Authenticate'
     */
    submitLabel?: string
  }
}