Preheat oven to 400F (200C).
In a larger skillet heat the olive oil over medium heat. Once hot add the thinly sliced onion and stir to coat completely.
Cook the onion until completely softened, about 10 minutes, and then add in the coconut sugar and apple cider vinegar. Stir to combine and continue to cook until the sugar has melted and has become almost syrupy in consistency. Set aside to cool slightly.
Roll out the thawed puff pastry sheet and transfer it to a baking sheet lined with parchment paper.
Score the pastry all around the edge with a fork and poke the inside of the pastry rectangle several times.
Spread 3 tablespoons of the fig jam across the inside of the puff pastry, avoiding the edges, and reserve the rest for later.
Arrange the cooked red onion across the pastry and then sprinkle on the feta cheese and cubed butter.
Fold in the edges to make a rim, and brush the edges with the egg and water mixture.
Bake in the preheated oven for 20-25 minutes until the edges of the pastry have become golden brown.
Remove from the oven and use a pastry brush to brush the remaining fig jam over the edges (for best results warm the jam in the microwave to give it a looser texture that makes brushing easier).
Allow to cool for a few minutes, slice, and serve.