@versini/auth0-auth-js-stub
v1.0.0
Published
Featherweight no-op stub of @auth0/auth0-auth-js for apps that use only basic Auth0 login (no MFA/Passkey/MyAccount/DPoP). Consumed via a pnpm `npm:` alias override to drop ~26KB gzip (openid-client + oauth4webapi + jose) from first paint. See @versini/au
Maintainers
Readme
@versini/auth0-auth-js-stub
A featherweight, no-op stub of @auth0/auth0-auth-js.
The real package pulls in openid-client + oauth4webapi + jose (~26 KB gzip of
first-paint weight) and powers only the MFA / Passkey / MyAccount / DPoP APIs. If
your app uses only basic Auth0 login (loginWithRedirect, getAccessTokenSilently,
logout, isAuthenticated, user), that weight is dead code.
This stub satisfies the symbols @auth0/auth0-spa-js imports at runtime. AuthClient
constructs without throwing (it runs on every login), and any MFA/Passkey method call
throws a clear, actionable error.
Usage
Don't depend on this directly. It is installed in place of @auth0/auth0-auth-js via a
pnpm npm: alias override, together with the slimmed @auth0/auth0-react and
@auth0/auth0-spa-js forks. See @versini/auth0-thin
for the full setup and the CI verifier.
# pnpm-workspace.yaml
overrides:
"@auth0/auth0-react": "npm:@versini/auth0-react-thin@<version>"
"@auth0/auth0-spa-js": "npm:@versini/auth0-spa-js-no-authjs@<version>"
"@auth0/auth0-auth-js": "npm:@versini/auth0-auth-js-stub@<version>"⚠️ Only safe if your app never uses Auth0 MFA, Passkey, MyAccount, or DPoP. Run
npx auth0-thin verifyin CI to enforce that the assumption still holds.
License
MIT. This stub is original code; it contains no Auth0 source.
