Madeleines are truly best served warm, and definitely best served within an hour of baking them. They lose moisture quite quickly, so they’re not a cake I suggest making ahead of time. But as I mentioned above, you can make the batter ahead of time, then bake off fresh batches as needed.
https://bakerbynature.com/classic-french-madeleines/