Clean the onions and slice them lengthwise.
Place the onions in a glass or ceramic bowl and add the vinegar, sugar and bay leaves.
Mix, cover with plastic wrap and leave to rest for a couple of hours. Stir occasionally.
When the onions have softened, remove the bay leaves and pour everything into a saucepan.
Put the saucepan on the fire and let it cook on medium-low heat.
When the onions are soft, blend them a little with an immersion blender.
Add the pectin and stir until fully dissolved.
Continue cooking until the cooking liquid has halved its volume.
Put the red onion jam in the sterilised jars, taking care to distribute the liquid in all the jars.
Close the jars and turn them upside down to create the vacuum and let them cool until the next day or at least 12 hours.