Fried Onion Dippers with Balsamic Ketchup

Ingredients
Method
Cook garlic in oil in a 2- to 3-quart heavy saucepan over medium heat, stirring, until golden, about 1 minute.
Add vinegar and boil over medium heat until slightly thickened, about 2 minutes.
Stir in ketchup, sugar, mustard, cloves, allspice, cayenne (if using), and salt and bring to a boil, then reduce heat and simmer, stirring occasionally, 5 minutes, until it's thick and well blended.
Transfer to a bowl and let cool to room temperature.
Heat oven to 200°F.
Whisk together flour, club soda, and salt in a bowl until smooth. Trim both ends of onion and then peel it. Halve onion lengthwise, then cut lengthwise into 3/4-inch-wide wedges. Separate wedges into pieces.
Heat 2 inches oil in a 4- to 5-quart heavy pot over medium heat until it registers 365°F on thermometer.
Working in batches of about 8, toss onion wedges in batter until coated. Lift onion pieces out of batter one at a time, letting excess batter drip off, and carefully transfer to hot oil. Fry onion dippers, turning with a slotted spoon, until golden, about 2 minutes, then transfer with slotted spoon to paper towels to drain. (Return oil to 365°F between batches.)
Sprinkle dippers with salt while still hot and keep warm on a rimmed baking sheet in oven until all onions have been fried.