Basic authentication plugin for Elysia v1.0.7. Provides HTTP Basic Auth middleware for the Elysia web framework (peer dependency elysia >= 0.7.1). Supports user-defined credentials, realm configuration, custom error messages, route exclusion via glob patterns, and optional error suppression. Last updated in 2024; no frequent releases. Differentiates by being purpose-built for Elysia with TypeScript types and Bun compatibility.
npm install elysia-basic-authNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up an Elysia server with basic auth middleware protecting all routes except /public/**
Update elysia to >= 0.7.1
Use { basicAuth } import syntaxEnsure routes handle undefined responses or set noErrorThrown: false
Consider forking or using alternative auth plugins
Double-check glob patterns, e.g., '/public/**' excludes only routes starting with /public/
Use import syntax or set "type": "module" in package.json and use .mjs extension
Run 'bun add elysia-basic-auth' or 'npm install elysia-basic-auth'
Use named import: import { basicAuth } from 'elysia-basic-auth'