Closing Lightbox after "Add to cart"

So I’ve added a Lightbox to a purchase page and added a “Add to Cart” button in it.
I want the Lightbox to close immidiatly after clicking the “Add to Cart” button.
How can I make this happen?

Hey
You will want to use this

import wixWindow from 'wix-window';
wixWindow.lightbox.close();

Read more about method