Small AC to DC converter

If its UL approved for use in a wall cavity, go for it, otherwise you would be acting recklessly.
If its cheap and not UL approved in the first place, not good.