FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
stevekrouse
stevekrousediscordWebhook
Public
Like
1
discordWebhook
Home
Code
2
README.md
S
main.tsx
Branches
1
Pull requests
Remixes
3
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
README.md

Send a Discord message

Send a message to a Discord channel from Val Town. It's useful for notifying your team or community when someone interesting happens, like a user signup, Stripe payment, mention on social media, etc.

Create val
import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook"; await discordWebhook({ url: Deno.env.get("engDiscord"), content: "Hi from val town!", });

Example val: https://www.val.town/v/stevekrouse.discordWebhookEx

Setup

1. Create a Discord Webhook

Follow the instructions here: https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks

It really only takes 2 minutes.

2. Copy webhook URL

Paste it into your secrets as discordWebhook.

3. Send a message!

Create val
import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook"; await discordWebhook({ url: Deno.env.get("engDiscord"), content: "Hi from val town!", });

Example val: https://www.val.town/v/stevekrouse.discordWebhookEx

Migrated from folder: utils/discordWebhook

Code
README.md
S
main.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.