Hiya Rachel,
(((HUGS))). It's such a stressful thing. When Ciara was doing this I would just leave if I was planning to go out, but make sure she knew I was leaving. This was the same for whoever she was with - Dp, family, childminder. It was really difficult for dp, as I think he felt bad that she didn't want him.
At bedtime we were also quite firm, but did go in to check on her and reassure her - kiss then right back out again.
It did pass but it was a difficult time. For us, consistency was key x