Get Logged in customer from within a plugin

Hi. I wrote a plugin because I want to get the id of the customer that is currently logged in to my shop.

Right now I am using the FooterPageletLoadedEvent to call my code - because I couldn’t find something else that is working with shopware 6.

I tried to call /store-api/v3/account/customer as described here Shopware 6: Store api account routes but the endpoint is telling me, that the customer is not logged in. Is this the correct way or is there any variable set with the customer id that is logged in to the shop?

I also tried any other ideas from the net - sadly they are all for shopware 5 or lower. I couldn’t get those to work with shopware 6.