Swings/boppy

I read that babies shouldn't sleep in swings/boppy etc for long periods of time when you are also sleeping but my baby will only sleep in these types of things. What can I do?