Add butter to a medium saucepan over low heat.
Once melted add sliced onions and cook gently for 45 minutes, stirring every so often until they are soft and caramelised. Set aside to cool.
Preheat oven to 200°C. Prepare a flat baking tray with baking paper.
Lay puff pastry on the baking paper. Score a line with a knife about 2cm inside the edge all the way around to create a boarder (do not cut all the way through the pastry).
With a fork prick the pastry all over inside the boarder. This will stop the pastry from rising in the centre while creating a nice crispy, puffy boarder.
Evenly spread caramelised onions over the pastry, staying inside the boarder.
Tear half the goat's cheese into chunks and evenly distribute over the top of the caramelised onions.
In a small bowl beat the egg and using a pastry brush, brush egg around the boarder of the pastry.
Bake in the oven for 30 mins or until the pastry is golden brown.
Remove from the oven, top with the remaining goat's cheese and sprinkle with the fresh thyme leaves.
Enjoy the tart either warm or at room temperature with a green salad.