This guide walks you from an empty .NET 8 console project to a working SportsX integration: install the NuGet package, wire up dependency injection, authenticate against staging, fetch live markets, and place a resting limit order.Documentation Index
Fetch the complete documentation index at: https://docs.sportsxapp.com/llms.txt
Use this file to discover all available pages before exploring further.
Before you begin
- .NET 8 SDK installed (
dotnet --versionshould print8.x) - A SportsX account that can log in to app-staging.on.sportsxapp.com
Walkthrough
Create a project and install the SDK
Create a new console project and add the Confirm the package resolved correctly:You should see
STX.Sdk NuGet package along with the hosting package needed for dependency injection:STX.Sdk listed with its version number.Register STX services
STX.Sdk integrates with the standard .NET DI container through a single extension method, ConfigureSTXServices. It registers every service the SDK provides — GraphQL clients, Phoenix channel classes, user storage, and background workers for session keep-alive and geolocation.Replace Program.cs with the following:Program.cs
The
{0} placeholder in channelsUri is intentional — the SDK substitutes your JWT before opening the WebSocket connection.Set credentials and run
Export your staging account credentials, then run the project:Expected output:
STXWrongCredentialsException
STXWrongCredentialsException
Your email or password is incorrect for the staging environment. Staging and production accounts are separate — confirm you can log in at app-staging.on.sportsxapp.com with the same credentials.
HttpRequestException
HttpRequestException
The endpoint URL is unreachable. Check that
graphQLUri is set to the staging URL above and that your network allows outbound HTTPS to in-api-staging.stxapp.io.Place a resting order and cancel it
After the market fetch, pick an open market and submit a small limit order. The price of 10¢ is deliberately low so the order rests in the book without matching, letting you test the full placement and cancellation flow without taking a real position.Add the following after your market-fetch code in Run the project again — you should see both the placed and cancelled order IDs printed to the console.
Program.cs:What you just did
- Created a .NET 8 console project and installed
STX.Sdkfrom NuGet. - Registered all SDK services in one call with
ConfigureSTXServices, pointing at the staging endpoints. - Authenticated with
STXLoginService.LoginAsync— the token is automatically stored inSTXUserStorageand attached to every subsequent request. - Fetched live market data with
STXMarketService.GetMarketInfosAsync. - Placed and cancelled a resting limit order using
STXOrderService.
Next steps
Authentication
2FA, keep-session-alive background service, and manual token refresh.
Configuration
Per-environment endpoints, pulling URIs from
appsettings.json, and DI tips.Trading
Cancel-all, batch orders, and cancel-on-disconnect.
WebSockets
Subscribe to portfolio, order status, trade tape, and market updates.