Is it safe to eat peanuts during pregnancy

I'm 30 weeks pregnant & had a doctor appointment yesterday and he told me to eat a lot of protein so I ate some trail mix.....I went online and it said that peanuts can cause an allergic reaction. Good thing I'm not allergic to peanuts but can this harm the baby?