Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
BreweryAuth
✓ const BreweryAuth = require('brewery-auth')
✗ import BreweryAuth from 'brewery-auth'
CJS only; no default ESM export.
BreweryAuth
✓ const BreweryAuth = require('brewery-auth').default
✗ const BreweryAuth = require('brewery-auth')
If using TypeScript with esModuleInterop, some bundlers may require .default.
BreweryAuth
✓ import BreweryAuth from 'brewery-auth'
✗ import { BreweryAuth } from 'brewery-auth'
Default export only, not a named export.
Instantiates BreweryAuth with environment config and performs a login.
const BreweryAuth = require('brewery-auth');
const config = {
dbConfig: {
databaseName: process.env.DB_NAME ?? '',
username: process.env.DB_USERNAME ?? '',
password: process.env.DB_PASSWORD ?? '',
dialect: process.env.DB_DIALECT ?? '',
host: process.env.DB_HOST ?? ''
},
salt: process.env.SALT ?? '',
tokenSecret: process.env.ACCESS_TOKEN_SECRET ?? '',
refreshSecret: process.env.REFRESH_TOKEN_SECRET ?? '',
nexmoSecret: process.env.NEXMO_API_SECRET ?? '',
nexmoKey: process.env.NEXMO_API_KEY ?? '',
sendgridKey: process.env.SENDGRID_API_KEY ?? '',
senderEmail: process.env.SENDER_EMAIL ?? '',
senderSms: process.env.SENDER_SMS ?? ''
};
const auth = new BreweryAuth(config);
auth.login({ clientId: 'my-client', clientSecret: 'my-secret' })
.then(result => console.log(result))
.catch(err => console.error(err));
Errors
Common errors & fixes
TypeError: BreweryAuth is not a constructor
Importing as named instead of default in CJS.
fixUse const BreweryAuth = require('brewery-auth'); Cannot find module 'brewery-auth'
Package not installed or name misspelled.
fixRun npm install brewery-auth-test and require as 'brewery-auth' (note: npm name is brewery-auth-test but require path is brewery-auth).
Error: ENOENT: no such file or directory, open '...'
Missing configuration file or environment variable.
fixEnsure .env file exists and contains all required variables.
Audit
Dependencies
passportrequiredCore authentication middleware