Sleeping on our bed

FTM with an almost 4 week old. My baby has bad reflux for which she is on Pepcid for. Not sure if the meds are working tbh but we also tried reclining her bassinet and she sleeps for a couple minutes but then wants to be picked up. Recently we found her to sleep so well on our bed. Our mattress is on the firmer side, queen size, and we keep absolutely nothing around her. She stays swaddled and on her back. Either my husband or I will sleep near her on the opposite side of the bed and us laying down doesn't change the mattress position or move her at all, I know you're not supposed to technically do this but this is the only way our baby sleeps for longer stretches. Is this ok? Especially considering our mattress is firmer and we ensure nothing is around her and neither of us would be able to accidentally roll on top of her?