Adding a button to the toolbar menu

I was wondering if it was possible to add a button or a dropdown to the Unity toolbar (where the account dropdown, unity services, play buttons, layers dropdown, …).
Found this but can’t find how to work around with
UnityCsReference/Modules/EditorToolbar/ToolbarElements/AccountDropdown.cs at master · Unity-Technologies/UnityCsReference · GitHub
If someone knows about this topic, I would appreciate you sharing your knowledge.
Than you

This is not officially supported by unity yet. Maybe at some point there will be public access to the ModeService so we can define our own Modes similar to the safemode that you can enter when you open a project with compile errors. I’ve tried accessing this feature via reflection and while it’s possible i don’t think it’s ready to use for anything meaningful you want people to interact with.

If you only want to extend the “normal” editor toolbar that’s displaying in every editor layout you can achieve it via reflection. I haven’t tested it but this repo does exactly that.

It’s unclear what you mean by Unity toolbar. MenuItem exists so you can add to the main menu and component context menus. If you want to add to the scene view toolbars you should make an Overlay.