STX.Sdk is distributed as a single NuGet package. You add one reference and the SDK handles everything else — GraphQL transport, WebSocket channels, JWT management, and Polly retries are all included transitively.
Add the package
.NET CLI
Package Manager Console
PackageReference
dotnet add package STX.Sdk
<PackageReference Include="STX.Sdk" Version="*" />
Or search for STX.Sdk in Visual Studio’s NuGet Package Manager UI.
Package page: nuget.org/packages/STX.Sdk
Runtime requirements
| |
|---|
| Target framework | net8.0 |
| Minimum .NET SDK | 8.0 |
| Platforms | Windows, macOS, Linux — any platform that runs .NET 8 |
Older versions of the package targeted net7.0. New projects should start on .NET 8.
Transitive dependencies
You do not need to reference any of these directly — they come in automatically with STX.Sdk:
| Package | Purpose |
|---|
GraphQL.Client + GraphQL.Client.Serializer.Newtonsoft | Typed GraphQL transport |
Microsoft.Extensions.Hosting.Abstractions | DI container and BackgroundService base classes |
Microsoft.Extensions.Http | IHttpClientFactory |
Microsoft.Extensions.Logging.Abstractions | ILogger<T> |
Microsoft.IdentityModel.Tokens, System.IdentityModel.Tokens.Jwt | JWT parsing |
Polly | Retry and transient-fault handling for GraphQL calls |
Using the SDK without a full host
The canonical pattern uses Host.CreateDefaultBuilder because it starts the DI container and runs background services (session keep-alive, geolocation). For lightweight scripts you can build your own ServiceCollection instead:
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>();
Background services (STXSessionBackgroundService, STXGeoLocationBackgroundService) won’t start automatically without a proper IHost. If you need automatic token refresh or geolocation, either run under Host.CreateDefaultBuilder or start those services explicitly.
Versioning
STX.Sdk follows semantic versioning:
- Major — breaking API changes
- Minor — new services or methods (backwards-compatible)
- Patch — bug fixes
Releases are tag-driven from the cssdk repo and published to NuGet automatically on each release tag.