Ther'eve been some built around the idea, like this:
https://endless-sphere.com/forums/viewtopic.php?f=28&t=70500
There's some similar ones with Yuba and Xtracycle-type builds, that have rear-side decks, with batteries built into those.
The one thing you'd want to be sure of is that it is completely waterproof, immersible, because if you happen to be anywhere that gets rain and end up in a deep enough puddle/etc....
(This just happened last week to me on the SB Cruiser, and thankfully I had not moved the battery to under the deck yet).