I have been exploring the concept of using InjectionToken for injecting environment variables (plain objects) into a service. I find myself puzzled as to the reasons and methods for incorporating tokens in Dependency Injection. Despite my efforts to research phrases like "When to use InjectionToken" and "Why should I use InjectionToken", I have not yet found a comprehensive article that addresses the necessity of InjectionToken.
From what I gather... tokens are typically employed to resolve conflicts between two primitives with identical values in DI, ensuring that one is prioritized over the other by the injector. However, the topic still remains rather obscure to me.
What are the benefits of utilizing tokens in DI? And under what circumstances should tokens be applied in DI? Any references to relevant articles on this subject would also be greatly appreciated.