Add the maple syrup or sugar, pumpkin purée, water and spices to a small saucepan. Whisk together over a medium heat until the sugar has completely dissolved, if using.
Reduce the heat to low and gently simmer for 5–8 minutes. Avoid letting it come to a rolling boil. This helps cook out the raw taste of the pumpkin and allows the spices to infuse.
Remove from the heat and stir through the vanilla extract.
Pour the mixture through a fine-mesh sieve into a bowl or jug, gently pressing the solids with the back of a spoon to extract as much syrup as possible.
Pour into a clean glass bottle or jar and leave to cool completely before sealing.
Store in the fridge for up to 2–3 weeks.