If you have a mains supply then you can use a mains adapter. Without a mains supply, an inverter can be used to convert 12V supply to mains. I have a small portable inverter which plugs into either our car or caravan 12V sockets, If you can use a USB charger you can get 12V USB sockets or use a cigarette lighter type socket with a USB adapter.
Most of the motorhomes & caravans we have had came with separate leisure batteries for the habitation supply, many also have electronics which shut down the load to avoid over discharging the batteries. Motorhomes typically have one or more 90-100Ah leisure batteries onboard, some have solar panels too.
I have used all if these methods in the past without flattening the batteries.