Packages
Trax ships as 42 NuGet packages from eight repositories. Most applications install four or five of them. This page lists every one: what it is for, the namespace you import to use it, the methods it adds, and what it needs beside it.
The pages describe the code on each repository's main branch. Each package versions on its own, so the docs do not name a version; the nuget.org link shows the latest release and its dependencies.
Which packages you need
Each layer depends on the one before it, and installing a package brings the layers below it with it. Pick the highest layer you need, then add one data provider.
| You want | Install |
|---|---|
| Typed pipelines only, no DI, no database | Trax.Core |
| Trains recorded in a database | Trax.Effect and one of Trax.Effect.Data.Postgres, Trax.Effect.Data.Sqlite, Trax.Effect.Data.InMemory |
| Dispatch by input type, startup chain checks | add Trax.Mediator |
| Cron and interval schedules, retries, dead letters | add Trax.Scheduler (needs a data provider; Postgres when several servers share the work) |
| A GraphQL API over your trains | add Trax.Api.GraphQL, plus an auth package such as Trax.Api.Auth.ApiKey or Trax.Api.Auth.Jwt |
| The monitoring UI | add Trax.Dashboard |
A typical API host with a scheduler and the dashboard:
dotnet add package Trax.Effect.Data.Postgres
dotnet add package Trax.Scheduler
dotnet add package Trax.Api.GraphQL
dotnet add package Trax.Api.Auth.ApiKey
dotnet add package Trax.DashboardTrax.Effect.Data.Postgres brings Trax.Effect.Data, Trax.Effect and Trax.Core; Trax.Scheduler brings Trax.Mediator. The using lines each method needs are in the tables below.
Trax.Core
| Package | What it is for | Import | Pairs with |
|---|---|---|---|
| Trax.Core | Trains, junctions and chains: Train<TIn, TOut>, Junction<TIn, TOut>, Chain, ShortCircuit, Resolve, Memory. No DI container or database needed. See Core. | Trax.Core.Train, Trax.Core.Junction; Either and Unit come from LanguageExt | Nothing. Every other Trax package builds on it. |
| Trax.Core.Testing | Architecture-guard infrastructure and hygiene checkers: HygieneGuards, RepoConventionGuards, VocabularyGuards, GuardResult. See Architecture Guards. | Trax.Core.Testing, Trax.Core.Testing.Guards, Trax.Core.Testing.Fixtures | A test project. The other *.Testing guard packages build on it. |
| Trax.Core.Analyzers | Deprecated. The Roslyn analyzer for CHAIN001 and CHAIN002 no longer reports anything; the host checks every chain at startup instead. Do not install it. See Analyzer. |
Trax.Effect
| Package | What it is for | Import | Pairs with |
|---|---|---|---|
| Trax.Effect | ServiceTrain<TIn, TOut>, which records every run as a Metadata row; DI registration with AddTrax, AddEffects, AddScopedTraxRoute and the other lifetimes; AddLifecycleHook, UseBroadcaster, SetEffectLogLevel; the [TraxAuthorize] and [TraxAllowAnonymous] attributes. See Effect. | Trax.Effect.Extensions for the registration methods, Trax.Effect.Services.ServiceTrain for the base class, Trax.Effect.Attributes for the attributes | One data provider below, to persist the runs. |
| Trax.Effect.Data | The shared data layer behind the three providers: IDataContext over the Trax tables, AddDataContextLogging, and DomainDataContext with AddDomainDataContext for your own schemas. See Domain Data Contexts. | Trax.Effect.Data.Extensions, Trax.Effect.Data.Services.DomainContext | Comes with each provider; install it directly only for a library that defines a DomainDataContext. |
| Trax.Effect.Data.Postgres | UsePostgres(connectionString) on the AddEffects builder, and SkipMigrations(). Persists runs to Postgres and applies the Trax schema migrations on startup. The production choice. See Data Persistence. | Trax.Effect.Data.Postgres.Extensions | Trax.Effect. Required by the scheduler when several servers share the work. |
| Trax.Effect.Data.Sqlite | UseSqlite(connectionString) on the AddEffects builder. For a single server or local development. See UseSqlite. | Trax.Effect.Data.Sqlite.Extensions | Trax.Effect. |
| Trax.Effect.Data.InMemory | UseInMemory() on the AddEffects builder. Runs are lost when the process exits. For tests and prototypes. See UseInMemory. | Trax.Effect.Data.InMemory.Extensions | Trax.Effect. |
| Trax.Effect.Data.Testing | Data-layer architecture guards: DataLayerGuards and DomainDataLayerGuardFixture (one schema per context, contexts derive DomainDataContext, owner-scope filters). See Architecture Guards. | Trax.Effect.Data.Testing | Trax.Core.Testing, in a test project. |
| Trax.Effect.Decisions.SystemOne | AddNimbleDecider(...): answers a train's decisions with Bespoke Labs' open-weights Nimble, on a Nimble server you run. AddSystemOneDecider(...) does the same for Jev or another server that accepts the System One format. See Decision Recording and Models. | Trax.Effect.Decisions.SystemOne.Extensions | Trax.Effect. |
| Trax.Effect.JunctionProvider.Logging | AddJunctionLogger(serializeJunctionData): logs each junction's start, finish and duration. See Junction Logger. | Trax.Effect.JunctionProvider.Logging.Extensions | Trax.Effect. Junctions must derive EffectJunction. |
| Trax.Effect.JunctionProvider.Progress | AddJunctionProgress(): writes the current junction to the Metadata row and checks for cancellation before each junction. See Junction Progress. | Trax.Effect.JunctionProvider.Progress.Extensions | Trax.Effect and a data provider, without which the host refuses to build. |
| Trax.Effect.Provider.Json | AddJson(): logs each tracked model's state as JSON while a train runs. For debugging. See JSON Effect. | Trax.Effect.Provider.Json.Extensions | Trax.Effect. |
| Trax.Effect.Provider.Parameter | SaveTrainParameters(): serializes each train's input and output into its Metadata row, masking members marked [TraxSensitive]. See Parameter Effect. | Trax.Effect.Provider.Parameter.Extensions | Trax.Effect and a data provider. |
| Trax.Effect.Broadcaster.RabbitMQ | UseRabbitMq(connectionString) on the UseBroadcaster builder, so lifecycle events raised in one process reach handlers in every other. See Broadcaster Sinks. | Trax.Effect.Broadcaster.RabbitMQ.Extensions | Trax.Effect. |
| Trax.Effect.Broadcaster.SignalR | UseSignalRHub() on the UseBroadcaster builder and MapTraxTrainEventHub() for the endpoint, so browser and Blazor clients see train events as they happen. See UseSignalRHub. | Trax.Effect.Broadcaster.SignalR.Extensions | Trax.Effect. |
| Trax.Effect.StateMachine | The snapshot state-machine engine: state as language-neutral JSON that a C# backend and a TypeScript client agree on, authored through IMachineBuilder. No dependencies. See State Machines. | Trax.Effect.StateMachine | Usually Trax.Effect.StateMachine.Persistence. |
| Trax.Effect.StateMachine.Persistence | Machine<TState, TTrigger>, the user-scoped snapshot store, the draft service, the exactly-once effect primitive, AddStateMachines and AddTraxStateMachineSelfCheck. See AddStateMachines. | Trax.Effect.StateMachine.Persistence | Trax.Effect and a data provider; AddStateMachines refuses to register without one. |
| Trax.Effect.StateMachine.Testing | Replays the differential corpus produced by the TypeScript engine through the C# engine and returns the cases it fails to reproduce, proving the two engines agree. See Codegen Pipeline. | Trax.Effect.StateMachine.Testing | A test project, and the corpus trax machine generate writes. |
Trax.Mediator
| Package | What it is for | Import | Pairs with |
|---|---|---|---|
| Trax.Mediator | AddMediator(...) on the AddTrax builder: discovers trains in the assemblies you name, dispatches by input type through ITrainBus, and refuses to start a host whose chains cannot run. See Mediator. | Trax.Mediator.Extensions for AddMediator, Trax.Mediator.Services.TrainBus for ITrainBus | Trax.Effect, and a data provider to record the runs. |
| Trax.Mediator.Testing | The EveryTrainHasInterface guard, through TrainGuards and TrainGuardFixture. See Architecture Guards. | Trax.Mediator.Testing | Trax.Core.Testing, in a test project. |
Trax.Scheduler
| Package | What it is for | Import | Pairs with |
|---|---|---|---|
| Trax.Scheduler | AddScheduler(...) on the AddTrax builder: cron and interval manifests, the work queue, retries, dead letters and dependent trains. Also ITraxScheduler for scheduling at run time, AddTraxWorker, AddTraxJobRunner with UseTraxRunEndpoint for remote runners, and AddTraxSchedulerLiveness. See Scheduling. | Trax.Scheduler.Extensions for the registration methods, Trax.Scheduler.Services.Scheduling for Every, Cron and Schedule, Trax.Scheduler.Services.TraxScheduler for ITraxScheduler | Trax.Mediator (brought with it) and a data provider. With Postgres or SQLite it runs jobs on local workers; with UseInMemory() it runs them inline. Use Postgres when several servers share the work. |
| Trax.Scheduler.Lambda | UseLambdaWorkers() and UseLambdaRun(): dispatch queued jobs and synchronous runs to an AWS Lambda function by direct invocation. See UseLambdaWorkers. | Trax.Scheduler.Lambda.Extensions | Trax.Scheduler in the scheduler host, and Trax.Runner.Lambda in the function. |
| Trax.Scheduler.Sqs | UseSqsWorkers(): dispatches queued jobs as SQS messages, plus the SQS-triggered Lambda consumer that runs them. See UseSqsWorkers. | Trax.Scheduler.Sqs.Extensions, Trax.Scheduler.Sqs.Lambda | Trax.Scheduler. |
| Trax.Runner.Lambda | TraxLambdaFunction, the base class for an AWS Lambda function that runs Trax trains. See TraxLambdaFunction. | Trax.Runner.Lambda | Trax.Scheduler.Lambda in the host that invokes it. |
Trax.Api
| Package | What it is for | Import | Pairs with |
|---|---|---|---|
| Trax.Api | The services behind the GraphQL API: AddTraxApi (which AddTraxGraphQL calls for you) and AddTraxHealthCheck. See API. | Trax.Api.Extensions | Comes with Trax.Api.GraphQL. |
| Trax.Api.GraphQL | AddTraxGraphQL(...) and UseTraxGraphQL(): a HotChocolate schema with queries, mutations and subscriptions generated from your trains. See API and AddTraxGraphQL. | Trax.Api.GraphQL.Extensions | A data provider and an auth package below. It brings Trax.Api, Trax.Mediator and Trax.Scheduler with it. |
| Trax.Api.GraphQL.Audit | AddAudit<TSink>() on the GraphQL builder: an audit entry for each operation, written to your sink. See AddAudit. | Trax.Api.GraphQL.Audit | Trax.Api.GraphQL. |
| Trax.Api.GraphQL.PersistedOperations | UsePersistedOperations(...) on the GraphQL builder and AddPersistedOperationStore: an allow-list of operations that callers run by id. See Persisted Operations. | Trax.Api.GraphQL.PersistedOperations.Extensions | Trax.Api.GraphQL. |
| Trax.Api.GraphQL.Testing | Cross-schema GraphQL guards through CrossSchemaGuards and CrossSchemaGuardFixture. See Architecture Guards. | Trax.Api.GraphQL.Testing | Trax.Core.Testing, in a test project. |
| Trax.Api.GraphQL.Client | A typed client for a Trax GraphQL API: AddTraxGraphQLClient(uri), AddKeyedTraxGraphQLClient, and ValidateGraphQLClientAssembliesAsync to check your request types against the schema. See GraphQL Client. | Trax.Api.GraphQL.Client | Any .NET caller; it needs no other Trax package. |
| Trax.Api.GraphQL.Client.Typed | TypedRequest<TResponse>, which generates the query string from attributed request and result types. See GraphQL Client. | Trax.Api.GraphQL.Client.Typed | Trax.Api.GraphQL.Client. |
| Trax.Api.GraphQL.Client.Trax | UseAssemblySchema(...) and UseStartupValidation(...) on the client builder: validate against the server's schema built in-process. See GraphQL Client. | Trax.Api.GraphQL.Client.Trax | Trax.Api.GraphQL.Client, in a .NET process that can reference the server's schema configuration. |
| Trax.Api.Auth | The principal model the auth packages share: TraxPrincipal, ITraxPrincipalResolver, AddTraxPrincipalAccessor. See TraxPrincipal. | Trax.Api.Auth | Comes with each auth package below. |
| Trax.Api.Auth.ApiKey | AddTraxApiKeyAuth(...): API-key authentication. See AddTraxApiKeyAuth. | Trax.Api.Auth.ApiKey | Trax.Api.GraphQL. |
| Trax.Api.Auth.Jwt | AddTraxJwtAuth(...), the AddTraxCognitoJwtAuth, AddTraxEntraJwtAuth and AddTraxGoogleJwtAuth presets, and AddTraxJwtDispatcher for several issuers on one endpoint. See AddTraxJwtAuth. | Trax.Api.Auth.Jwt | Trax.Api.GraphQL. |
| Trax.Api.Auth.Jwt.Cognito | UseCognito(region, userPoolId, clientId) on the JWT builder, which also checks Cognito's token_use claim. See UseCognito. | Trax.Api.Auth.Jwt.Cognito | Trax.Api.Auth.Jwt. |
| Trax.Api.Auth.Oidc | AddTraxOidcAuth(...): the browser-facing OpenID Connect code flow, with a session cookie. See AddTraxOidcAuth. | Trax.Api.Auth.Oidc | A host that browsers sign in to. Token-based API clients use Trax.Api.Auth.Jwt instead. |
| Trax.Api.Auth.Jwt.Testing | TestJwksServer and TestTokenIssuer: a local JWKS endpoint and signed tokens for integration tests. See JWT Testing. | Trax.Api.Auth.Jwt.Testing | Trax.Api.Auth.Jwt, in a test project. |
| Trax.Api.Auth.Jwt.Cognito.Issuer | CreateCognitoIssuer() on TestJwksServer: tokens shaped like Cognito's, for testing UseCognito. See Cognito Issuer. | Trax.Api.Auth.Jwt.Cognito.Issuer | Trax.Api.Auth.Jwt.Testing and Trax.Api.Auth.Jwt.Cognito, in a test project. |
Trax.Dashboard
| Package | What it is for | Import | Pairs with |
|---|---|---|---|
| Trax.Dashboard | AddTraxDashboard(...) and UseTraxDashboard(): the Blazor Server monitoring UI, mounted at /trax in your app. See Dashboard. | Trax.Dashboard.Extensions | Trax.Scheduler and a data provider (it brings Trax.Scheduler with it). |
Tools and templates
| Package | What it is for | Install | Pairs with |
|---|---|---|---|
| Trax.Cli | The trax dotnet tool: trax generate scaffolds a project from a GraphQL SDL or OpenAPI schema, and trax machine scaffolds a state machine and generates its TypeScript twin. See CLI. | dotnet tool install --global Trax.Cli | Nothing; it is a tool, not a library. |
| Trax.Samples.Templates | dotnet new templates: trax-api, trax-scheduler and trax-hub. See Templates. | dotnet new install Trax.Samples.Templates | Nothing; the generated projects reference the packages they need. |
SDK Reference
AddTrax / AddEffects | UsePostgres | AddMediator | AddScheduler | AddTraxGraphQL | AddTraxDashboard