Poison and its protocols are designed for this.
There might be alternatives available, but poison is in phoenix by default.