Skip to content

kdrs-cz/nuxt-weblock

Repository files navigation

Nuxt WebLock Module

npm version npm downloads License Nuxt

Nuxt 3 module to lock your whole website with password. All routes will be inaccessible until the correct password is entered.

Features

  • 🔒 Lock your whole website with password. Ideal for staging environments, client previews, etc.
  • 🍪 Successfully entered password will be stored in a cookie, so you don't have to enter it again.

nuxt-weblock screenshot

Quick Setup

  1. Add nuxt-weblock dependency to your project
# Using pnpm
pnpm add nuxt-weblock

# Using yarn
yarn add nuxt-weblock

# Using npm
npm install nuxt-weblock
  1. Add nuxt-weblock to the modules section of nuxt.config.ts/js and configure nuxt-weblock by defining webLock section
export default defineNuxtConfig({
  modules: [
    'nuxt-weblock'
  ],
  webLock: {
    password: '123456', // safer password might be a better idea 😁
    isEnabled: true // ideal to be set to false in production
  }
})

That's it! You can now use WebLock Module in your Nuxt app ✨

Development

# Install dependencies
yarn install

# Generate type stubs
yarn run dev:prepare

# Develop with the playground
yarn run dev

# Build the playground
yarn run dev:build

# Run ESLint
yarn run lint

# Release new version
yarn run release