Creating a component and adding the component to all your themes is the best way.
If you’ve updated recently, we’ve added the ability to add a component to all themes in a single click from the theme component’s settings.