Skip to main content

From NuGet

dotnet add package STX.Sdk
Or via Visual Studio’s NuGet Package Manager — search for STX.Sdk. Package page: nuget.org/packages/STX.Sdk.

Supported runtime

Target frameworknet8.0
Minimum .NET SDK8.0
PlatformsWindows, macOS, Linux (any platform with .NET 8)
Older versions of the package target net7.0. New projects should start on 8.

Dependencies

STX.Sdk pulls in a small set of battle-tested packages:
PackagePurpose
GraphQL.Client + GraphQL.Client.Serializer.NewtonsoftTyped GraphQL transport
Microsoft.Extensions.Hosting.AbstractionsDI + BackgroundService base classes
Microsoft.Extensions.HttpHttpClient factory
Microsoft.Extensions.Logging.AbstractionsILogger<T>
Microsoft.IdentityModel.Tokens, System.IdentityModel.Tokens.JwtJWT parsing
PollyRetry + transient-fault handling for GraphQL calls
You don’t need to reference any of these directly — they’re transitive through STX.Sdk.

Using the SDK without Microsoft.Extensions.Hosting

The canonical pattern uses Host.CreateDefaultBuilder(...) because that bootstraps the DI container and runs background services (session keep-alive, geolocation). For small scripts you can roll your own ServiceCollection:
var services = new ServiceCollection();
services.ConfigureSTXServices(
    graphQLUri:  "https://in-api-staging.stxapp.io/graphiql",
    channelsUri: "wss://in-api-staging.stxapp.io/socket/websocket?token={0}&vsn=2.0.0");

var provider = services.BuildServiceProvider();
var login = provider.GetRequiredService<STXLoginService>();
Trade-off: background services (STXSessionBackgroundService, STXGeoLocationBackgroundService) won’t start automatically. Start them explicitly if you need them, or pass keepSessionAlive: true to LoginAsync only when running under a proper IHost.

Versioning

STX.Sdk follows semantic versioning. Breaking changes bump the major version; new services/methods bump the minor; bug fixes bump the patch. The package is tag-driven from the cssdk repo and auto-published to NuGet on release.