How to inject a service in discourse?

Exactly! appEvents is a wrapper for Evented. If you prefer to use Evented directly then that’s also fine :+1:

https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/services/app-events.js#L4