Parent
#266 — Twitch EventSub: ingestão de eventos via webhook (data lake)
What to build
An Artisan command that links a Twitch channel to a tenant by creating an ExternalIdentity record, following the same pattern as GenerateDiscordTenant.
End-to-end behavior
After this slice, running php artisan twitch:link-channel danielhe4rt --tenant=he4rt-developers resolves the Twitch user ID via the Helix API, finds the target tenant, and creates an ExternalIdentity linking them. This establishes the "official channel" relationship for the tenant.
What changes
New — Command:
LinkTwitchChannelCommand in Console/ with signature twitch:link-channel {login} {--tenant= : Tenant slug or ID}
- Resolves broadcaster user ID by sending
GetUsers request via TwitchHelixConnector
- Finds tenant by slug or ID
- Creates
ExternalIdentity on the tenant with provider=Twitch, external_account_id=<broadcaster_user_id>, metadata containing login and display name
- Follows the
GenerateDiscordTenant pattern: IdentityType::External, CredentialsType::OAuth2, ClientAccessManager::make(), connected_at=now()
- Registers command in
IntegrationTwitchServiceProvider
Acceptance criteria
Blocked by
Parent
#266 — Twitch EventSub: ingestão de eventos via webhook (data lake)
What to build
An Artisan command that links a Twitch channel to a tenant by creating an
ExternalIdentityrecord, following the same pattern asGenerateDiscordTenant.End-to-end behavior
After this slice, running
php artisan twitch:link-channel danielhe4rt --tenant=he4rt-developersresolves the Twitch user ID via the Helix API, finds the target tenant, and creates anExternalIdentitylinking them. This establishes the "official channel" relationship for the tenant.What changes
New — Command:
LinkTwitchChannelCommandinConsole/with signaturetwitch:link-channel {login} {--tenant= : Tenant slug or ID}GetUsersrequest viaTwitchHelixConnectorExternalIdentityon the tenant withprovider=Twitch,external_account_id=<broadcaster_user_id>,metadatacontaining login and display nameGenerateDiscordTenantpattern:IdentityType::External,CredentialsType::OAuth2,ClientAccessManager::make(),connected_at=now()IntegrationTwitchServiceProviderAcceptance criteria
php artisan twitch:link-channel danielhe4rt --tenant=he4rt-developerscreates anExternalIdentitywithprovider=Twitchon the target tenantexternal_account_idis set to the resolved Twitch broadcaster user ID (not the login string)metadatacontains the channel login and display namevendor/bin/pint --dirty --format agentpassesphp artisan test --compact --filter=TwitchpassesBlocked by
TwitchHelixConnectorandGetUsersrequest)