Whooping cough needles

Ok so I’m getting told so many different things when it comes to getting your whooping cough needle to protect a new.

How many weeks does it need to be in your system before being able to come into contact with a new born.

Families they do your head in lol. Just trying to protect my new bundle of joy coming into the world any time now.