Search Results for

    Show / Hide Table of Contents

    Endpoints

    Thresh.Endpoints provides typed API groups built on top of ILcuHttpClient.

    Why use endpoint groups?

    • Centralized LCU paths
    • Minimal DTOs with stable JSON property mappings
    • Cancellation-aware async methods
    • Easy replacement/mocking in tests through interfaces

    Register endpoint services

    services
        .AddThresh()
        .AddThreshEndpoints();
    

    Available endpoint groups

    • ILolSummonerApi
      • GetCurrentAsync(...)
      • GetByPuuidAsync(...)
    • ILolGameflowApi
      • GetSessionAsync(...)
      • GetPhaseAsync(...)
    • ILolChampSelectApi
      • GetSessionAsync(...)
      • GetPickableChampionIdsAsync(...)
    • ILolLobbyApi
      • GetLobbyAsync(...)
      • GetReceivedInvitationsAsync(...)

    Example

    var summoner = provider.GetRequiredService<ILolSummonerApi>();
    var gameflow = provider.GetRequiredService<ILolGameflowApi>();
    
    var me = await summoner.GetCurrentAsync(ct);
    var phase = await gameflow.GetPhaseAsync(ct);
    
    Console.WriteLine($"{me?.DisplayName} - phase: {phase}");
    

    Stability guidance

    Endpoint groups are convenience APIs over the core abstractions. They are intentionally small and can evolve as the LCU surface changes. For long-term compatibility requirements, keep your domain logic isolated from DTO shape assumptions.

    • Edit this page
    In this article
    Back to top Generated by DocFX