# Sources and statuses

Events come from four sources. Donatty donations are available without connecting a source. Connect Donation Alerts, Twitch and YouTube separately. For requirements and delivery timing, see [source conditions](https://developers.donatty.com/en/conditions/sources.md).

| Source | What arrives | How to recognize it | Conditions |
|---|---|---|---|
| Donatty | donations through your donation page, goals | a donation with `source` set to `DONATTY`: [`Donation`](https://developers.donatty.com/en/structures/donation.md#donation); goals: [`Goal`](https://developers.donatty.com/en/structures/goal.md#goal) | [Donatty](https://developers.donatty.com/en/conditions/sources.md#donatty) |
| Donation Alerts | Donation Alerts donations | a donation with `source` set to `DONATION_ALERTS`: [`Donation`](https://developers.donatty.com/en/structures/donation.md#donation) | [Donation Alerts](https://developers.donatty.com/en/conditions/sources.md#donation-alerts) |
| Twitch | follows, subscriptions and gift subscriptions, bits, raids, channel point rewards, hype train levels | `twitch.*` events: [Twitch event formats](https://developers.donatty.com/en/structures/twitch-events.md) | [Twitch](https://developers.donatty.com/en/conditions/sources.md#twitch) |
| YouTube | new subscribers, channel members, Super Chats and Super Stickers | `youtube.*` events: [YouTube event formats](https://developers.donatty.com/en/structures/youtube-events.md) | [YouTube](https://developers.donatty.com/en/conditions/sources.md#youtube) |

## Donation Alerts

Donation Alerts donations arrive in the `donations` channel as the same `donation.created` event as Donatty donations, and in responses from the [Donations](https://developers.donatty.com/en/reference/donations.md) method. Their `source` is `DONATION_ALERTS`. For fields that are empty in these donations, see the [`Donation`](https://developers.donatty.com/en/structures/donation.md#donation) structure. To check the Donation Alerts connection, find the source with `platform` set to `DONATION_ALERTS` in the [source status](#source-status).

For delivery requirements and possible gaps, see the [Donation Alerts conditions](https://developers.donatty.com/en/conditions/sources.md#donation-alerts).

## Twitch

Twitch events arrive in the `twitch` channel as `twitch.*` events and in responses from [Platform events](https://developers.donatty.com/en/reference/platform-events.md): they are the same [`PlatformEvent`](https://developers.donatty.com/en/structures/platform-event.md#platformevent) objects. The fields of each type are in [Twitch event formats](https://developers.donatty.com/en/structures/twitch-events.md), the key scope is `twitch:read` ([key scopes](https://developers.donatty.com/en/tokens.md#secret-key-scopes)).

For connection requirements, when collection starts and event delays, see the [Twitch conditions](https://developers.donatty.com/en/conditions/sources.md#twitch). Step by step: the [Connect Twitch](https://developers.donatty.com/en/quickstart/twitch.md) quick start.

## YouTube

YouTube events arrive in the `youtube` channel as `youtube.*` events and in responses from [Platform events](https://developers.donatty.com/en/reference/platform-events.md): they are the same [`PlatformEvent`](https://developers.donatty.com/en/structures/platform-event.md#platformevent) objects. The amount of a Super Chat and a Super Sticker is [`ExactMoney`](https://developers.donatty.com/en/structures.md#exactmoney) in the viewer's currency. The fields of each type are in [YouTube event formats](https://developers.donatty.com/en/structures/youtube-events.md), the key scope is `youtube:read` ([key scopes](https://developers.donatty.com/en/tokens.md#secret-key-scopes)).

For connection requirements, the first poll, event delays and exhausted quotas, see the [YouTube conditions](https://developers.donatty.com/en/conditions/sources.md#youtube). Step by step: the [Connect YouTube](https://developers.donatty.com/en/quickstart/youtube.md) quick start.

## Source status

The [Event sources](https://developers.donatty.com/en/reference/event-sources.md) method shows whether Donatty is currently receiving events from your accounts: Donation Alerts with the `donations:read` scope, Twitch with `twitch:read`, YouTube channels with `youtube:read`. The request and the response are on the method page.

When the status or the `unavailableTypes` list changes, a `source.status_changed` event arrives with the same object: in the `donations` channel for Donation Alerts, in the `twitch` channel for Twitch and in the `youtube` channel for YouTube. All fields are in the [`SourceStatus`](https://developers.donatty.com/en/structures/event-source.md#sourcestatus) structure.

| Status | What it means | What to show the streamer |
|---|---|---|
| `IDLE` | no connections are requesting events from this account | open a connection with the right channel |
| `STARTING` | Donatty is connecting to the platform or waiting for Twitch to confirm the subscriptions; for YouTube, the first poll hasn't finished | "connecting" |
| `READY` | the platform confirmed the connection; for YouTube, polling is running and progressing for every available type, with no fixed delay. Types from `unavailableTypes` still don't arrive, and an event arrives only when it happens on the platform | nothing: everything works |
| `CAPACITY_LIMITED` | Donation Alerts only: Donatty waits for a free slot for the connection | "Donation Alerts donations may not arrive" |
| `QUOTA_LIMITED` | YouTube only: Donatty's daily YouTube quota is used up; for when polling resumes, see the [YouTube conditions](https://developers.donatty.com/en/conditions/sources.md#youtube) | "YouTube events will arrive later or may not arrive" |
| `REAUTH_REQUIRED` | access to the account was revoked | "link the account in your dashboard again" |
| `ERROR` | the platform rejected access for another reason, or polling is disabled or has stalled | "the platform's events don't arrive" |

Treat an unknown status as not ready.

## Gaps: gapSince and unavailableTypes

- `gapSince` marks when a possible gap began. `gapSince: null` does not guarantee that no events were missed. To catch up, see [How to read the gap](https://developers.donatty.com/en/realtime/recovery.md#how-to-read-the-gap) and the [Stream and catch-up](https://developers.donatty.com/en/examples/stream-recovery.md) example.
- `unavailableTypes` lists the Twitch and YouTube event types that don't arrive now for a known reason. An empty list doesn't mean everything is ready: look at `status` too. For why a type may be unavailable, see the [source conditions](https://developers.donatty.com/en/conditions/sources.md).

The API server stores the current status in memory and keeps no separate history of status changes. After an API server restart, `since` is the time that server first observes the source.
