{"id":14266915,"url":"https://github.com/BlossomiShymae/Briar","last_synced_at":"2025-08-13T16:33:21.257Z","repository":{"id":250401950,"uuid":"834382849","full_name":"BlossomiShymae/GrrrLCU","owner":"BlossomiShymae","description":"A simple wrapper for the LCU.","archived":false,"fork":false,"pushed_at":"2024-08-29T12:22:04.000Z","size":270,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-01T21:45:40.193Z","etag":null,"topics":["lcu","lcu-api","league-of-legends"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BlossomiShymae.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-27T05:32:07.000Z","updated_at":"2024-11-30T09:38:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"1fad4b24-570f-4bab-9621-3daf9e2bd582","html_url":"https://github.com/BlossomiShymae/GrrrLCU","commit_stats":null,"previous_names":["blossomishymae/grrrlcu"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlossomiShymae%2FGrrrLCU","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlossomiShymae%2FGrrrLCU/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlossomiShymae%2FGrrrLCU/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlossomiShymae%2FGrrrLCU/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlossomiShymae","download_url":"https://codeload.github.com/BlossomiShymae/GrrrLCU/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229772739,"owners_count":18121916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lcu","lcu-api","league-of-legends"],"created_at":"2024-08-22T17:00:32.983Z","updated_at":"2025-08-13T16:33:21.225Z","avatar_url":"https://github.com/BlossomiShymae.png","language":"C#","funding_links":[],"categories":["Developer Tools"],"sub_categories":[],"readme":"# Briar\n\n[![NuGet Stable](https://img.shields.io/nuget/v/BlossomiShymae.Briar.svg?style=flat-square\u0026logo=nuget\u0026logoColor=black\u0026labelColor=69ffbe\u0026color=77077a)](https://www.nuget.org/packages/BlossomiShymae.Briar/) [![NuGet Downloads](https://img.shields.io/nuget/dt/BlossomiShymae.Briar?style=flat-square\u0026logoColor=black\u0026labelColor=69ffbe\u0026color=77077a)](https://www.nuget.org/packages/BlossomiShymae.Briar/)\n\nBriar is a wrapper for the League Client and Game Client APIs which are unofficially provided by Riot Games.\n\nThis library is currently compatible with .NET 8 and higher for Windows and MacOS.\n\n## Contributors\n\n\u003ca href=\"https://github.com/BlossomiShymae/Briar/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=BlossomiShymae/Briar\" /\u003e\n\u003c/a\u003e\n\n## Usage\n\n### Installation\n\n```bash\ndotnet install BlossomiShymae.Briar\n```\n\n### Sample application\n\n[A demonstration of Briar with more code examples can be found here.](https://github.com/BlossomiShymae/Briar/blob/main/BlossomiShymae.Briar.Demo/Program.cs)\n\nTo run the demo, clone the repo and then do:\n```bash\ndotnet run --project BlossomiShymae.Briar.Demo\n```\n\n### Requesting the LCU\n\nThis library uses the `System.Net.Http.HttpClient` interface via `LcuHttpClient`. It comes with a built-in handler that takes care of the request path and authorization header.\n\n\u003e [!NOTE]\n\u003e The built-in handler will attempt to refresh the port and auth if a `HttpRequestException` is encountered **on request**. `InvalidOperationException` will be thrown if the port of the current LCU process cannot be found or the port cannot be connected to.\n\n\n#### Getting the LcuHttpClient instance\n\n```csharp\nvar client = Connector.GetLcuHttpClientInstance();\n```\n\n#### General request\n\n```csharp\nvar response = await client.SendAsync(new(HttpMethod.Get, \"/lol-summoner/v1/current-summoner\"));\n\nvar me = await response.Content.ReadFromJsonAsync\u003cSummoner\u003e();\n```\n\n#### GET request\n\n```csharp\nvar me = await client.GetFromJsonAsync\u003cSummoner\u003e(\"/lol-summoner/v1/current-summoner\");\n```\n\n#### POST request with JSON body\n\n```csharp\nvar response = await client.PostAsJsonAsync(\"/player-notifications/v1/notifications\", playerNotificationResource);\n\nvar resource = await response.Content.ReadFromJsonAsync\u003cPlayerNotificationResource\u003e();\n```\n\n\u003e [!WARNING]\n\u003e `ProcessFinder.IsActive()` does not necessarily mean that the LCU process port is open for requests. Use `ProcessFinder.IsPortOpen()` instead.\n\n#### Utilities\n\n```csharp\nvar leagueClientProcess = ProcessFinder.GetProcess();\nvar processInfo = ProcessFinder.GetProcessInfo();\nvar isActive = ProcessFinder.IsActive();\nvar isPortOpen = ProcessFinder.IsPortOpen();\n\nvar riotAuthentication = new RiotAuthentication(processInfo.RemotingAuthToken);\n```\n\n### Requesting the Game Client\n\n#### Getting the GameHttpClient instance\n\n```csharp\nvar client = Connector.GetGameHttpClientInstance();\n```\n\n#### General request\n\n```csharp\nvar response = await client.SendAsync(new(HttpMethod.Get, \"/liveclientdata/activeplayername\"));\n\nvar me = await response.Content.ReadFromJsonAsync\u003cstring\u003e();\n```\n\n#### GET request\n\n```csharp\nvar me = await client.GetFromJsonAsync\u003cstring\u003e(\"/liveclientdata/activeplayername\");\n```\n\n### LCU WebSocket\n\nThis library uses the `Websocket.Client` wrapper.\n\nCreate a client:\n\n```csharp\nvar client = Connector.CreateLcuWebsocketClient();\n```\n\nListen to events, disconnections, or reconnection messages:\n\n```csharp\nusing System; // Include to avoid compiler errors CS1503, CS1660.\n              // You may or may not need this.\n\nclient.EventReceived.Subscribe(msg =\u003e\n{\n    Console.WriteLine(msg?.Data?.Uri);\n});\nclient.DisconnectionHappened.Subscribe(msg =\u003e \n{\n    if (msg.Exception != null) throw msg.Exception;\n});\nclient.ReconnectionHappened.Subscribe(msg =\u003e\n{\n    Console.WriteLine(msg.Type);\n});\n```\n\nUse it:\n\n```csharp\n// This starts the client in a background thread. You will need an event loop\n// to listen to messages.\nawait client.Start();\n\n// Subscribe to every event that the League Client sends.\nvar message = new EventMessage(EventRequestType.Subscribe, EventKinds.OnJsonApiEvent);\nclient.Send(message);\n\n// We will need an event loop for the background thread to process.\nwhile(true) await Task.Delay(TimeSpan.FromSeconds(1));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBlossomiShymae%2FBriar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBlossomiShymae%2FBriar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBlossomiShymae%2FBriar/lists"}