In a small saucepan, melt the butter over low heat with the onions, garlic, and ginger root.
In the meantime, warm up a dry cast iron skillet, or other heavy-bottomed skillet, over low heat. Add the spices and raise the heat to medium-high. Toast the spices, constantly stirring, for a couple of minutes or until they start to become fragrant.
Add the toasted spices to the pan with the melted butter and stir. Allow the spices to infuse into the butter, over low heat, for about an hour. You want the butter to be good and warm, but no need to simmer.
Line a fine mesh strainer with cheese cloth and set it over a small bowl. Pour the butter into the cheesecloth lined strainer so that it drains into the bowl. Squeeze the cheesecloth to wring out all of the spiced butter.
Pour the spiced butter into a half-pint mason jar and cap. Store it in the refrigerator.