NestJS module wrapping oidc-provider v8+, enabling ESM-only OIDC provider integration in NestJS applications. Version 2.1.0 requires NestJS >=9, oidc-provider >=8.5.1, and Node >=18. Provides decorators (@InjectOidcModule, @InjectOidcProvider), OidcModule.forRoot(), and automatic ESM detection to work around NestJS's CJS-only runtime. Key differentiator: handles the oidc-provider v8 ESM transition transparently, re-exports all types, and supports custom factory functions, proxy trust, and dynamic host routing. Ships TypeScript definitions.
npm install nest-oidc-providerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic NestJS module setup with OIDC provider, a client, PKCE disabled, and cookie keys.
Import everything from 'nest-oidc-provider' and use @InjectOidcModule() / @InjectOidcProvider() to access provider internals. If you need types, use the re-exports from this package.
Use type assertion: (provider as import('oidc-provider').Provider).someMethod()Use forRoot({ ... }) with the factory option to customize provider instantiation.Remove any import from 'oidc-provider' in your NestJS code. Use imports from 'nest-oidc-provider' instead.
npm install oidc-provider --save
Ensure the OidcModule is imported in the appropriate module (usually AppModule). Check that @InjectOidcProvider() is used in the same module context.