In a large Dutch oven or ovenproof pan over medium heat, melt the butter. Add the onions and cook until a deep golden brown color is reached, about 1 hour, stirring every 5 – 10 minutes. If the bottom starts to burn, turn the heat down to medium-low and deglaze the pan with a little water. Lightly season with salt.
Preheat the oven to 350˚F (180˚C).
Add the garlic, thyme and flour into the onions. Stir and cook for a minute. Add half of the broth. Deglaze the pan. Bring to a boil and reduce to a simmer for 5 minutes.
Meanwhile, season the chicken thighs with salt and pepper. In another large pan over medium-high heat, add the oil. Add the chicken, skin-side down, and sear for 3 – 4 minutes until golden brown. Turn over and sear for another 3 – 4 minutes.
Back to the onions, add the remaining broth, balsamic vinegar and mustard. Bring to a boil and simmer to reduce by half, about 5 minutes. Season with salt and pepper to taste.
Place the chicken in the onions. Cover with a lid or foil. Bake in the oven for 20 minutes. Turn up the oven to 425˚F (220˚C). Sprinkle the cheese over the chicken and onions. Return to oven until the cheese is melted, about 3 – 4 minutes. Remove from oven and let it rest for 5 minutes. Serve with baguette.