FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
mattx
mattxverify_discord_signature
Public
Like
1
verify_discord_signature
Home
Code
2
README.md
S
main.tsx
Branches
1
Pull requests
Remixes
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

verify_discord_signature

Verify HTTP signatures coming from Discord.

  • public_key should be the Ed25519 public key from Discord, as a hex string
  • body should be the request body as a string. If you have a JSON object as the request body, use JSON.stringify.
  • signature should be the X-Signature-Ed25519 header
  • timestamp should be the X-Signature-Timestamp header You must return a 401 error and return early if this function returns false, otherwise you will pretty quickly get a big scary warning from Discord that your endpoint has been removed. Note that you'll only be able to add one once you've integrated this correctly.

As this function only deals with strings, it doesn't matter whether you use an Express or web endpoint.

Migrated from folder: discord/verify_discord_signature

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.