Streamlabs.SocketClient
1.1.1
dotnet add package Streamlabs.SocketClient --version 1.1.1
NuGet\Install-Package Streamlabs.SocketClient -Version 1.1.1
<PackageReference Include="Streamlabs.SocketClient" Version="1.1.1" />
paket add Streamlabs.SocketClient --version 1.1.1
#r "nuget: Streamlabs.SocketClient, 1.1.1"
// Install Streamlabs.SocketClient as a Cake Addin #addin nuget:?package=Streamlabs.SocketClient&version=1.1.1 // Install Streamlabs.SocketClient as a Cake Tool #tool nuget:?package=Streamlabs.SocketClient&version=1.1.1
Streamlabs.SocketClient
Unofficial C# client library for the Streamlabs socket API. Allows you to receive events from Streamlabs in real-time.
Installation
dotnet add package Streamlabs.SocketClient
If you use Dependency Injection, you can use the Streamlabs.SocketClient.Extensions package for easier setup.
dotnet add package Streamlabs.SocketClient.Extensions
// provide the token directly
builder.Services.AddStreamlabsClient(options => options.Token = "store your token somewhere safe");
// or use a configuration section
builder.Services.AddStreamlabsClient(configuration.GetSection("Streamlabs"));
// automatically connect and disconnect the client
builder.Services.AddHostedService<StreamlabsStartStopWorker>();
// get the client via DI and use it
var client = serviceProvider.GetRequiredService<IStreamlabsClient>();
client.OnDonation += (sender, message) => Console.WriteLine($"Donation Received: {message.FormattedAmount}");
Usage
First, you'll need to grab your Socket API Token
from the Streamlabs Dashboard.
Open the Dashboard, then navigate to Avatar Menu
→ Account Settings
→ API Settings
→ API Tokens
.
You will find the token in the field Your Socket API Token
.
Now you're ready to set up the client. These examples show how to set up the client and listen for events:
Contributing
Pull requests are welcome. Please use Conventional Commits to keep commit messages consistent.
When reporting bugs, please include the raw JSON payload of the event that caused the issue. You can find it attached to
the error message or by enabling debug logging and looking for Streamlabs: Event received - [json]
.
Alternatively, you can use the Event Capture
tool to capture events and save them to a file.
Acknowledgements
- Streamlabs API Documentation
- SocketIOClient by @doghappy is a great library for working with SocketIO servers in C#.
- Streamlabs-Events-Receiver by @ocgineer is a similar project that served as inspiration for this one.
License
Distributed under the MIT License. See LICENSE
for more information.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
- SocketIOClient (>= 3.1.2)
- System.Text.Json (>= 8.0.5)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
- SocketIOClient (>= 3.1.2)
- System.Text.Json (>= 8.0.5)
-
net9.0
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Options (>= 9.0.0)
- SocketIOClient (>= 3.1.2)
- System.Text.Json (>= 9.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Streamlabs.SocketClient:
Package | Downloads |
---|---|
Streamlabs.SocketClient.Extensions
Extensions for Streamlabs.SocketClient |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.1.1 | 475 | 11/12/2024 |
1.0.0 | 160 | 10/27/2024 |
0.2.28 | 583 | 4/20/2024 |
0.2.26 | 179 | 4/20/2024 |
0.2.16 | 259 | 3/30/2024 |
0.2.15 | 186 | 3/30/2024 |
0.2.0 | 211 | 2/28/2024 |
0.1.0 | 152 | 2/23/2024 |
0.1.0-alpha.112 | 145 | 11/16/2023 |
0.1.0-alpha.91 | 84 | 10/9/2023 |
0.1.0-alpha.81 | 89 | 9/18/2023 |
0.1.0-alpha.79 | 79 | 9/18/2023 |
0.1.0-alpha.72 | 80 | 9/16/2023 |
0.1.0-alpha.69 | 87 | 9/12/2023 |
0.1.0-alpha.33 | 105 | 7/2/2023 |
0.1.0-alpha.26 | 91 | 6/19/2023 |
0.1.0-alpha.22 | 93 | 6/19/2023 |
0.1.0-alpha.20 | 89 | 6/18/2023 |
0.1.0-alpha.16 | 93 | 6/18/2023 |