Sift cocoa powder into a medium saucepan to eliminate lumps.
Add sugar and salt to the saucepan. Whisk dry ingredients together for 30 seconds until evenly combined.
Add water gradually while whisking vigorously to prevent lumps. Start with ¼ cup, whisk until smooth, then add remaining water.
Place saucepan over medium heat and whisk constantly as mixture heats.
Bring to a gentle simmer, stirring continuously for 5-7 minutes until mixture transforms from grainy to smooth and glossy.
Reduce heat to low and simmer for 2-3 minutes more. The syrup will thicken as it cools.
Remove from heat and let cool for 3-5 minutes.
Stir in vanilla extract and any additional flavorings. Mix thoroughly.
Pour syrup into a heat-safe glass jar or bottle using a funnel to prevent spills.
Cool to room temperature before sealing the lid to prevent condensation.
Refrigerate once cool. Syrup will thicken significantly when chilled.