Skip to main content

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

  1. If the kill-switch (platform:{provider}) is disabled -- everything is blocked
  2. If the kill-switch is enabled -- check the sub-flag:
    • platform:{provider}:login -- controls login availability
    • platform:{provider}:channel -- controls channel connections
    • platform:{provider}:bot -- controls bot connections
  3. 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 with is_provider_enabled(platform, subtype, account_id) for two-level flag checks, get_enabled_providers(subtype) for listing enabled platforms per connection type, and get_enabled_platforms() for kill-switch-level queries.
  • REST (apps/api/src/routes/features.rs) -- Public GET /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 and connectionStatuses with enabled field.

Frontend

  • ID App -- SSR login page and signIn callback check enabledProviders to 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

MethodPathDescription
GET/v1/providers/enabled?type={login|channel|bot}List enabled providers

Admin Endpoints

MethodPathDescription
GET/v1/admin/providersList all providers with stats
PATCH/v1/admin/providers/{platform}/toggleToggle kill-switch
PATCH/v1/admin/providers/{platform}/{subtype}/toggleToggle sub-flag
GET/v1/admin/accounts/{id}/connectionsList channel connections
DELETE/v1/admin/accounts/{id}/connections/{platform}Delete channel connection
GET/v1/admin/accounts/{id}/bot-connectionsList bot connections
DELETE/v1/admin/accounts/{id}/bot-connections/{platform}Delete bot connection
GET/v1/admin/accounts/{id}/se-tokensList 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

TypeNameDescription
QueryenabledProviders(connectionType)List enabled providers
QueryconnectionStatusesPlatform statuses with enabled field
QuerybotConnectionStatusesBot 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

PathDescription
apps/api/src/services/feature_service.rsCore feature flag resolution logic
apps/api/src/routes/features.rsPublic providers REST endpoint
apps/api/src/routes/admin.rsAdmin provider management endpoints
apps/api/src/db/admin.rsFeature flag DB operations and seed data
apps/api/src/graphql/connections.rsGraphQL queries with provider enablement

See Also