Skip to main content
Apps can listen to events happening in Discord to stay up-to-date with changes and updates to servers, users, and even your app. The following sections cover basic information about the different transport methods that can be used to receive events, and link out to relevant documentation.

Receiving Events

There are many event types that can be accessed using different transport methods:
  • Gateway events are sent over a WebSocket connection between your app and Discord, and is the primary way to receive and send events. Most events are only available via Gateway connections.
  • Webhook events are sent to your appโ€™s Webhook Event URL over HTTP.
  • SDK events are sent to your app when using the Embedded App SDK.
Read details about each way to receive events in the sections below.

Using Gateway

Gateway events are the primary way apps can listen and send events. Most events related to resources in Discord, like updates to channels, guilds, roles, and messages, are only available over Gateway. Gateway events are sent over a WebSocket-based Gateway connection between Discord and your app. To receive Gateway events, your app must open and maintain a persistent Gateway connection which you can read details about in the Gateway documentation. To make receiving Gateway events simpler, we suggest using a developer library which helps setup, maintain, and handle common pitfalls with Gateway connections (like rate limits). Details about receiving events using the Gateway API is in the Gateway documentation, and the full list of available Gateway events is in the Gateway Events documentation.

Using Webhooks

Webhook events let you receive a small number of events over HTTP. While many events arenโ€™t supported over HTTP, some events like Application Authorized (sent when your app is installed to a user or server) arenโ€™t available using other transport methods like Gateway. Find the list of webhook events and details about subscribing and handling them in the Webhook Events documentation.

Using the Embedded App SDK

When developing Activities, you can listen to a collection of SDK events, like updates to a userโ€™s voice status or screen orientation. To listen to SDK events, you can call subscribe() with the SDK event name. Details about listening to events using the Embedded App SDK is in the Embedded App SDK documentation.

Next Steps