How to safely add lipo battery to XIAO nRF52840 Sense

Hello, I am designing a custom macropad that can be used wired and wireless. I can not find a clear resource or example for my desired usage. I would like to safely add a lipo battery with all necessary protections for charging, overcharge, short-circuit and discharge protection.

From what I have gathered, although the microcontroller datasheet claims it can manage charging a battery it does not fully have all the necessary protections. I think I would need to add lipo charging module such as the integrated circuit MCP73871 with a load sharing circuit so I can use the macropad wired safely and when it is unplugged, it can switch the load to the battery.

However, I am not sure of how to wire these components together since the MCP73871 module I found has its own usb c port and I would not like to have two ports on my macropad. Furthermore, how can I connect this to the XIAO nRF52840 Sense ? I found a blog that recommends the following
image
which is a power management board with MCP73871 and a step up booster board. but not sure how to apply this to the XIAO controller ?

Also from this Texas Instruments forum (BQ24075: Shorting IN and OUT Together - Power management forum - Power management - TI E2E support forums), where someone attempted to add a battery management module to a Seeeduino, he claims that " When powered from the USB port, the 5V pad is just a pass-through. Alternatively, you can supply the 5V pad from an external supply, which won’t back-feed through the USB port thanks to the inline diode. What I didn’t know is that the VIN pad on the bottom of the board is ALSO tied directly to the 5V pad." Which causing shorting the in and out ports. Is this the same for the XIAO nRF52840 Sense ?

Any advice would be greatly appreciated.