Heat a medium sauté pan over medium-high heat. Add the butter and allow it to melt. Stir in the onions and season with salt and pepper. Cook the onions for 2–3 minutes or until just starting to brown. Turn the heat down to medium-low, add in the herbes de provence, and continue to cook the onions, stirring occasionally, until well caramelized, about 20–25 minutes.
Deglaze the pan with the brandy and continue to cook for a few minutes to cook off the alcohol and allow the flavours to meld.
While the onions cook, preheat the oven to 425ºF and set out a large cookie sheet lined with a piece of parchment paper. Unroll the frozen puff pastry onto the parchment and, using a fork, poke all around the dough leaving about a 1-inch boarder all around the outside edge.
Brush the dough with the dijon mustard, again, leaving that 1-inch boarder around the edge. Evenly spread the caramelized onions over the mustard and scatter with the grated gruyere cheese. Brush the boarder with a light coating of the egg wash and season the whole tart with salt and pepper.
Bake the tart in the preheated oven for 10 minutes then reduce the heat to 375ºF and continue to bake until the pastry and cheese is a deep golden brown, about 20 to 25 minutes longer.
Served warm scattered with a little fresh thyme, if using, and a nice glass of French wine on the side and you'll feel like you're sitting in a café in Paris!