Registry /
auth-security / test-backend-schema-library
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.
ValidateTokenModule
✓ import { ValidateTokenModule } from 'career-edge-backend-auth-library'
✗ import ValidateTokenModule from 'career-edge-backend-auth-library'
Default export does not exist; use named import.
TokenService
✓ import { TokenService } from 'career-edge-backend-auth-library'
✗ const { TokenService } = require('career-edge-backend-auth-library')
Package is ESM-only, requires import syntax.
TokenGuard
✓ import { TokenGuard } from 'career-edge-backend-auth-library'
✗ import { TokenGuard } from 'career-edge-backend-auth-library/guards'
TokenGuard is re-exported from the main entry point, not a subpath.
Shows module registration with all required configuration fields and TokenService injection in a NestJS service class.
import { Module } from '@nestjs/common';
import { ValidateTokenModule } from 'career-edge-backend-auth-library';
@Module({
imports: [
ValidateTokenModule.register({
AWS_COGNITO_JWK_URL: process.env.COGNITO_JWK_URL ?? '',
AWS_API_VERSION: process.env.API_VERSION ?? '2016-04-18',
AWS_REGION: process.env.AWS_REGION ?? '',
AWS_ACCESS_KEY_ID: process.env.AWS_ACCESS_KEY_ID ?? '',
AWS_SECRET_ACCESS_KEY: process.env.AWS_SECRET_ACCESS_KEY ?? '',
DATABASE_CONNECTION_STRING: process.env.MONGO_URI ?? '',
DATABASE_NAME: process.env.DATABASE_NAME ?? '',
}),
],
providers: [],
controllers: []
})
export class AppModule {}
// In a service:
import { Injectable } from '@nestjs/common';
import { TokenService } from 'career-edge-backend-auth-library';
@Injectable()
export class ExampleService {
constructor(private readonly tokenService: TokenService) {}
async validate(token: string) {
return this.tokenService.validateToken(token);
}
}
Errors
Common errors & fixes
Cannot find module 'career-edge-backend-auth-library'
Package not installed or import path incorrect.
fixRun npm install career-edge-backend-auth-library and ensure the import statement is correct.
TypeError: ValidateTokenModule.register is not a function
Likely using a default import instead of named import, or the module has changed its API.
fixUse named import: import { ValidateTokenModule } from 'career-edge-backend-auth-library'. If problem persists, check version >=2.0.0. MongooseError: Mongoose connection error: missing database name
DATABASE_CONNECTION_STRING does not contain the database name, and DATABASE_NAME is empty.
fixProvide a valid MongoDB URI that includes the database name (e.g., mongodb://localhost:27017/mydb).
JsonWebTokenError: invalid signature
JWT token does not match the JWK from Cognito; possibly wrong JWK URL or token expired.
fixVerify AWS_COGNITO_JWK_URL is correct and the token is still valid.
Audit
Dependencies
@nestjs/commonrequiredRequired for module registration and dependency injection
mongooserequiredUsed for MongoDB database connection
jsonwebtokenrequiredJWT verification against Cognito JWKs
aws-sdkrequiredAWS SDK for Cognito operations