Provider Management
Overview
Provider Management allows admins to globally enable or disable platform providers (Twitch, YouTube, Kick, Trovo, Discord, Spotify) with granular controls per connection type. Each provider has a kill-switch that disables everything, plus sub-flags for login, channel, and bot connections.
Feature Flag Hierarchy
Each provider has a kill-switch and sub-flags for different connection types:
platform:twitch <- Kill-switch (disables everything)
+-- platform:twitch:login <- Login via Twitch
+-- platform:twitch:channel <- Channel Connection
+-- platform:twitch:bot <- Bot Connection
Resolution Logic
- If the kill-switch (
platform:{provider}) is disabled -- everything is blocked - If the kill-switch is enabled -- check the sub-flag:
platform:{provider}:login-- controls login availabilityplatform:{provider}:channel-- controls channel connectionsplatform:{provider}:bot-- controls bot connections
- If a sub-flag doesn't exist -- allowed by default
Soft-Block Behavior
When a provider or sub-flag is disabled:
- New connections/logins are blocked
- Existing connections continue working
- Token refresh continues
- Global bots keep running
- Per-account overrides are possible via the admin panel
Architecture
Backend
- FeatureService (
apps/api/src/services/feature_service.rs) -- Core service withis_provider_enabled(platform, subtype, account_id)for two-level flag checks,get_enabled_providers(subtype)for listing enabled platforms per connection type, andget_enabled_platforms()for kill-switch-level queries. - REST (
apps/api/src/routes/features.rs) -- PublicGET /v1/providers/enabled?type={login|channel|bot}endpoint. Returns list of enabled provider slugs. - Admin REST (
apps/api/src/routes/admin.rs) -- Admin endpoints for provider stats, toggle, and account connection management. - GraphQL (
apps/api/src/graphql/connections.rs) --enabledProviders(connectionType)query andconnectionStatuseswithenabledfield.
Frontend
- ID App -- SSR login page and signIn callback check
enabledProvidersto gate login buttons. - Web App -- Connection flow checks provider enablement before showing connect options.
- Admin App -- Dedicated Provider Management page for toggling flags and viewing stats.
Admin Management
Provider Page
The admin panel includes a dedicated Provider Management page where admins can:
- Toggle the kill-switch per platform
- Toggle individual sub-flags (Login / Channel / Bot)
- View system credential status
- View connection counts
Account Connections
On the account detail page, admins can:
- View and delete channel connections
- View and delete bot connections
- View and delete StreamElements tokens
User Login Connections
On the user detail page, admins can delete individual login connections.
API
Public Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /v1/providers/enabled?type={login|channel|bot} | List enabled providers |
Admin Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /v1/admin/providers | List all providers with stats |
| PATCH | /v1/admin/providers/{platform}/toggle | Toggle kill-switch |
| PATCH | /v1/admin/providers/{platform}/{subtype}/toggle | Toggle sub-flag |
| GET | /v1/admin/accounts/{id}/connections | List channel connections |
| DELETE | /v1/admin/accounts/{id}/connections/{platform} | Delete channel connection |
| GET | /v1/admin/accounts/{id}/bot-connections | List bot connections |
| DELETE | /v1/admin/accounts/{id}/bot-connections/{platform} | Delete bot connection |
| GET | /v1/admin/accounts/{id}/se-tokens | List SE tokens |
| DELETE | /v1/admin/accounts/{id}/se-tokens/{token_id} | Delete SE token |
| DELETE | /v1/admin/users/{id}/login-connections/{provider} | Delete login connection |
GraphQL
| Type | Name | Description |
|---|---|---|
| Query | enabledProviders(connectionType) | List enabled providers |
| Query | connectionStatuses | Platform statuses with enabled field |
| Query | botConnectionStatuses | Bot platform statuses with enabled field |
Per-Account Overrides
Admins can override provider flags per account using the existing account feature override system. On the account detail page, toggle any platform:* or platform:*:* flag in the Feature Overrides tab.
Key Files
| Path | Description |
|---|---|
apps/api/src/services/feature_service.rs | Core feature flag resolution logic |
apps/api/src/routes/features.rs | Public providers REST endpoint |
apps/api/src/routes/admin.rs | Admin provider management endpoints |
apps/api/src/db/admin.rs | Feature flag DB operations and seed data |
apps/api/src/graphql/connections.rs | GraphQL queries with provider enablement |
See Also
- Bot Connections -- Custom bot identities per account
- Connections -- Channel connection OAuth flow
- Token Refresh -- Automatic token refresh worker