unstale

npm / basic-auth

basic-auth

What changed in basic-auth 2 to 3, from its official release notes, upgrade guides and advisories. Also covers @types/basic-auth. Sources checked 2026-11-30.

6 breaking1 new APIs and options1 performance2 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

basic-auth 38 changes

Breaking changes 4

  • Removes the default export; use parse(str) instead.

    3.0.0release notes

  • The package is published as ESM, changing the module format developers use when consuming it.

    3.0.0release notes

  • The supported Node.js versions are now >=22.

    3.0.0release notes

  • The parse method now expects a string.

    3.0.0release notes

New APIs and options 1

  • Adds a format method that accepts name and pass.

    3.0.0release notes

Performance 1

  • Parse performance improved by approximately 15%.

    3.0.0release notes

Fixes and other changes 2

  • Validates base64 before decoding, aligning Node.js and native JavaScript decoding behavior.

    3.1.0release notes

  • Adds cross-platform base64 support.

    3.0.0release notes

basic-auth 22 changes

Breaking changes 2

  • The auth(ctx) signature was removed; pass in a header or use auth(ctx.req) instead.

    2.0.0release notes

  • Support for Node.js below 0.8 was dropped.

    2.0.0release notes