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.
KeyGenerator
✓ import { KeyGenerator } from 'brightspace-auth-keys'
✗ const KeyGenerator = require('brightspace-auth-keys').KeyGenerator
ESM-only since v9; CommonJS require still works in Node 20+
AbstractPublicKeyStore
✓ import { AbstractPublicKeyStore } from 'brightspace-auth-keys'
✗ const { AbstractPublicKeyStore } = require('brightspace-auth-keys')
ESM-only since v9
default import
✓ import brightspaceAuthKeys from 'brightspace-auth-keys'
✗ const brightspaceAuthKeys = require('brightspace-auth-keys')
Package has no default export; import * from or named imports required
Shows subclassing AbstractPublicKeyStore, instantiating KeyGenerator with EC settings, and retrieving the current private key.
import { KeyGenerator, AbstractPublicKeyStore } from 'brightspace-auth-keys';
class MyStore extends AbstractPublicKeyStore {
async _storePublicKey(key, expiry) {
// store key string with expiry
}
async _lookupPublicKeys() {
// return array of key strings
return [];
}
}
const store = new MyStore();
const keyGenerator = new KeyGenerator({
signingKeyType: 'EC',
ec: { crv: 'P-256' },
lifetimes: { keyUse: 3600, token: 300 },
publicKeyStore: store
});
const privateKey = await keyGenerator.getCurrentPrivateKey();
console.log('Private key obtained:', privateKey);
Errors
Common errors & fixes
TypeError: Class constructor AbstractPublicKeyStore cannot be invoked without 'new'
Calling AbstractPublicKeyStore as a function without new in ES module context
fixUse class extends AbstractPublicKeyStore { ... } and instantiate with new MyStore() Error: signingKeyType must be either 'RSA' or 'EC'
Missing or invalid signingKeyType option in KeyGenerator constructor
fixSet signingKeyType: 'EC' or signingKeyType: 'RSA' in options
TypeError: store._storePublicKey is not a function
Store instance does not implement _storePublicKey method required by AbstractPublicKeyStore
fixImplement _storePublicKey(key, expiry) method returning a Promise
Audit
Dependencies
No dependency data recorded yet.