Thaw puff pastry according to package instructions.
Peel the onions into thick slices, approximately half an inch.
In a pan over medium heat, disperse the onions evenly. Pour over boiling water until covered, and then leave to simmer for 20 minutes, until the water has evaporated.
Add the balsamic vinegar, maple syrup, a drizzle of olive oil and a sprinkle of salt. Allow the onions to caramelize slightly, until browned. Remove the pan from the heat.
Preheat the oven to 400F. Prepare a pie or tart pan, approximately 8.5 x 10, with oil.
Disperse the cooked onions in an even layer in the pan, then layer the puff pastry over top. Tuck the pastry around the onions.
Place in the oven for 30 minutes, until the pastry is browned. Carefully, once cooled slightly, use your oven mitts to flip the pastry upside down onto a serving platter or cutting board. Garnish with fresh thyme, if desired. Slice and enjoy immediately, or store in the fridge for up to 3 days.