Beyond simple @Injectable() classes, NestJS supports custom providers — flexible ways to define what gets injected — using injection tokens. This lets you inject values, configure how instances are created, swap implementations, and inject non-class dependencies.
The four custom provider types
({
: [
{ : , : },
{ : , : { : , : } },
{
: ,
: (: ) => {
(config.());
},
: [],
},
{ : , : },
],
})
{}
