Melatonin while pregnant ??? Pls help

Bri

FirSt time momma here! I suffer from extreme anxiety and my brain will not turn off at night and I will not sleep if I don’t take it. My question is can I take it while pregnant - what does Dr.’s recommend! Please help!