A Discord webhook URL looks like an address, so it feels fine to put it in your page's JavaScript. It works more like a key. Discord's developer docs list three calls that need nothing but that URL: Get Webhook with Token, Modify Webhook with Token and Delete Webhook with Token. Each one "does not require authentication." So anyone who opens your page source can post to your channel, rename the webhook and give it a new avatar, or delete it. Once it's deleted your form stops delivering, and you find out when a customer asks why you never answered.
That's the whole problem. The rest of this piece is how common it is and how to fix it.
We're Formgong, and we make a form backend that posts to Discord. Our product is in the last section, and you can skip it.
How common it is
On 9 November we searched GitHub code for HTML files containing discord.com/api/webhooks . GitHub reports about 4,900 of them. We read the first 200 results in full.…