MY WEBCAM TEST GUIDE

How to send Twitch live notifications to Discord with a webhook

Set up a Discord webhook for Twitch go-live alerts: create and test the webhook, connect a service or your own EventSub script, and confirm it works end to end.

The short answer

A Discord webhook can post a "we're live" message into a channel, but it can only receive messages. It cannot watch Twitch on its own. To get automatic live alerts, something else has to notice that your stream started and then send a message to the webhook. That something is either a notification bot or automation service you connect to Twitch, or a small script of your own that subscribes to Twitch's "stream online" event and forwards it to Discord.

One point causes frequent confusion. Linking your Twitch account under Discord's Connections settings is a different feature. It ties the accounts together for your profile and status. It does not post an announcement to a server channel, so it is not a substitute for the webhook setup described here.

Pick how the live event will be detected

Route | What detects the stream | What you maintain | Main trade-off
Third-party notification bot or automation service | The service watches Twitch for you | The service settings and the webhook URL or bot permissions | Little technical work, but you rely on that service's features and reliability
Your own script using Twitch EventSub | Twitch sends a stream.online event to your server | A Twitch developer app, a publicly reachable HTTPS endpoint and your code | Full control over message content, but you host and maintain it

Gap in the evidence: no verified information was available about specific services, their features, limits or prices, so this guide does not recommend one. Some services ask for a Discord webhook URL. Others ask you to invite their bot to your server instead. Check the service's own documentation to see which method it uses before you create anything.

Before you start

  • A Discord server where your role has the Manage Webhooks permission (server owners and administrators have it by default)
  • The text or announcement channel where alerts should appear
  • The Twitch channel you want to announce
  • For the do-it-yourself route only: a Twitch developer application and a server or hosted function reachable over HTTPS

Step 1: Create the Discord webhook

  • 1. In Discord, open the server menu and choose Server Settings, then Integrations. You can also open the settings of the specific channel and choose Integrations there.
  • 2. Select Webhooks, then create a new webhook.
  • 3. Give it a recognizable name, such as Stream Alerts. Optionally add an avatar. These appear as the sender of each alert.
  • 4. Choose the channel the webhook should post to.
  • 5. Use Copy Webhook URL and save the changes.

Success check: the webhook appears in the Webhooks list with the name and channel you chose. Treat the copied URL like a password. Anyone who has it can post into that channel without logging in.

Step 2: Test the webhook by itself

Test the webhook before you involve Twitch. If something fails later, you will then know the Discord side is not the cause. From a terminal, send a simple message. Replace the placeholder with your copied URL:

curl -X POST -H "Content-Type: application/json" \
  -d '{"content":"Webhook test - please ignore"}' \
  "YOUR_DISCORD_WEBHOOK_URL"

Success check: the test message appears in the chosen channel under the webhook's name. The command itself usually prints nothing, because Discord answers a successful post with an empty response. This test proves the URL is valid and the channel accepts posts. It does not test live detection or mention pings.

To ping people when you go live, include the mention in the message text and list the allowed mention type. Without that, the text may show but no one gets notified. A role is mentioned by its ID in the form <@&ROLE_ID>. An example message body:

{
  "content": "@everyone YourName is live on Twitch! Watch here: YOUR_TWITCH_CHANNEL_LINK",
  "allowed_mentions": { "parse": ["everyone"] }
}

Step 3: Connect a live-detection source

Option A: A notification service

  • 1. In the service, add your Twitch channel as the account to watch.
  • 2. Paste the Discord webhook URL as the destination, or invite the service's bot if it works that way.
  • 3. Write the announcement text and any mention you want.
  • 4. Use the service's test or preview button if it has one.

Success check: the test post arrives in your channel with the expected text and mention. A test button only shows that the service can reach Discord. Whether it correctly detects your stream is confirmed only in Step 4.

Option B: Your own script with Twitch EventSub

EventSub is Twitch's system for pushing events to you instead of making you check repeatedly. You ask Twitch to watch a channel for the stream.online event. When the stream starts, Twitch sends a notification to a web address you control, and your code then posts to the Discord webhook.

  • 1. Register an application in the Twitch developer console and note its client ID and client secret.
  • 2. Use the client credentials flow to obtain an app access token.
  • 3. Look up the numeric user ID of the broadcaster you want to watch. A subscription needs the ID, not the channel name.
  • 4. Deploy an HTTPS endpoint that can receive POST requests from Twitch.
  • 5. Create the subscription by sending the request below to the EventSub subscriptions endpoint. Include your Client-Id header and an Authorization header that contains your app access token.
  • 6. Handle the verification request. Twitch first sends a message whose Twitch-Eventsub-Message-Type header is webhook_callback_verification. Your endpoint must respond with the challenge value from the body as plain text, with a success status.
  • 7. For later messages of type notification, verify the signature, respond with a success status right away, and post your announcement to the Discord webhook.
{
  "type": "stream.online",
  "version": "1",
  "condition": { "broadcaster_user_id": "YOUR_BROADCASTER_ID" },
  "transport": {
    "method": "webhook",
    "callback": "YOUR_HTTPS_CALLBACK",
    "secret": "YOUR_RANDOM_SECRET"
  }
}

Signature checking stops strangers from triggering fake alerts. Twitch computes an HMAC-SHA256 hash of three values joined together: the message ID header, the timestamp header and the raw request body. It uses your secret as the key. Your code should do the same calculation and compare the result with the Twitch-Eventsub-Message-Signature header. Twitch may deliver the same event more than once, so record message IDs and skip any you have already handled. That prevents double announcements.

The stream.online event identifies the broadcaster and the start time, but it does not include the stream title or category. If you want those in the alert, look them up through Twitch's streams endpoint after the event arrives.

Success check: when you list your EventSub subscriptions, the new one shows an enabled status. If it stays pending, the verification challenge was not answered correctly. If it shows a failure status, check your endpoint's logs.

Step 4: Confirm it works end to end

Only a real stream start proves the whole chain. If you prefer not to ping your community during testing, first point the setup at a private test channel or a separate test webhook. Then start a short stream and watch for the alert. Once it arrives, switch the destination back to the real channel.

Success check: one message arrives in the right channel shortly after you go live, with the correct text, link and mention. This confirms that Twitch reported the stream as online and that your setup forwarded it. It does not confirm that your camera, microphone or scenes are reaching viewers. Check the live stream itself or a viewer's playback for that.

If the alert does not appear

  • Step 2 test fails: the webhook URL is wrong or was deleted or regenerated. Copy it again from Integrations.
  • Message posts but nobody is pinged: add the allowed mention type, and confirm the role ID and the channel's mention permissions.
  • Service test works but live alerts never arrive: confirm the service is watching the correct Twitch channel and that the webhook URL has not changed.
  • EventSub subscription stays pending: your endpoint did not return the challenge as plain text with a success status.
  • Alerts arrive twice: deduplicate by Twitch message ID, and make sure two services are not both posting.
  • Alerts arrive late or are missed: make sure your endpoint answers Twitch quickly and is reachable over HTTPS. Twitch can retry or revoke subscriptions on failing endpoints.

If the webhook URL is ever exposed, for example pasted into a public chat or committed to a shared repository, delete that webhook in Discord and create a new one. Then update the URL wherever you use it.