SDK Reference

Complete reference documentation for every user-facing method in Trax. Each page documents the method signature, all parameters, return type, and usage examples.

For conceptual explanations and tutorials, see Core, Effect, and Mediator.

Categories

Trains and Junctions (Core, Effect)

The base classes you derive from and the helpers that register them: Train<TInput, TReturn>, ServiceTrain<TIn, TOut>, Junction<TIn, TOut>, EffectJunction<TIn, TOut>, IRoute, MonadTask, TrainException and TrainExceptionData.

Includes: Train, ServiceTrain, Junction, EffectJunction, IRoute, MonadTask, TrainException, AddScopedTraxRoute / AddTransientTraxRoute / AddSingletonTraxRoute.

Attributes (Effect)

Every attribute Trax reads, in one place: authorization, sensitive data, remote execution, GraphQL exposure.

Includes: [TraxAuthorize], [TraxAllowAnonymous], [TraxSensitive], [TraxRemote], [Inject], and links to [TraxQuery], [TraxMutation], [TraxBroadcast], [TraxQueryModel], [TraxConcurrencyLimit].

Train Methods (Core)

Methods available on Train<TInput, TReturn> for composing junctions. Junctions() is the only way to declare a chain.

Includes: Junctions, Chain, ShortCircuit, Extract, AddServices, Resolve, Run / RunEither.

Configuration (Effect)

The AddTrax entry point and every extension method on the builder types (TraxBuilder, TraxBuilderWithEffects, TraxBuilderWithMediator), TraxEffectBuilder, and TraxEffectBuilderWithData -- data providers, effect providers, and orchestration setup. The builder pattern enforces configuration ordering at compile time: Effects -> Mediator -> Scheduler. Data provider methods (UsePostgres, UseInMemory) return TraxEffectBuilderWithData, which unlocks data-dependent methods like AddDataContextLogging at compile time.

Includes: UsePostgres, UseInMemory, AddJson, SaveTrainParameters, AddJunctionLogger, AddDataContextLogging, AddMediator, AddEffect, AddJunctionEffect, SetEffectLogLevel, IDataContext, DomainDataContext, IJunctionEffectProvider, ITraxTrainEventClient.

Mediator API (Mediator)

The ITrainBus interface for dynamically dispatching trains by input type, plus shared train discovery and execution services.

Includes: RunAsync, InitializeTrain, AddMediator, AddServiceTrainBus, ITrainDiscoveryService, ITrainExecutionService, ITrustedExecutionScope, ICurrentPrincipalProvider, IConcurrencyLimiter, MediatorConfiguration.

Scheduler API (Scheduler)

Scheduler configuration (AddScheduler + SchedulerConfigurationBuilder) and the runtime ITraxScheduler interface for scheduling, managing, and monitoring recurring trains.

Includes: AddScheduler, ITraxScheduler, Schedule, ScheduleMany, dependent scheduling, manifest management, dead letters, scheduling helpers (Every, Cron, ManifestOptions).

State Machine API (Effect)

Authoring portable snapshot state machines and hosting them: one-line discovery and wiring, plus the fluent builder for declaring states, transitions, guards, reducers, committed states, and exactly-once effects.

Includes: AddStateMachines, Machine<TState, TTrigger>, IMachineBuilder, StateMachineMutations, AddTraxStateMachineSelfCheck.

Dashboard API (Dashboard)

Setup and configuration for the Trax Blazor dashboard.

Includes: AddTraxDashboard, UseTraxDashboard, DashboardOptions, IDashboardSettingsService.

GraphQL API (API)

GraphQL schema for Trax using HotChocolate. Exposes train discovery, execution (via [TraxQuery]/[TraxMutation] whitelist), scheduler operations, and read-only queries.

Includes: AddTraxGraphQL, UseTraxGraphQL, [TraxQuery]/[TraxMutation] attributes, queries, mutations, AddTraxHealthCheck.

GraphQL Client (API)

The outbound client: hand-written queries validated against the server's schema before they are sent, with keyed registrations for talking to several servers.

Includes: AddTraxGraphQLClient, AddKeyedTraxGraphQLClient, TraxGraphQLClientBuilder, ValidateGraphQLClientAssembliesAsync, IGraphQLClientRequest, GraphQLResourceRequest, ResponseStrictness.

API Auth (API)

NO WARRANTY. Trax auth is plumbing, not a security product. You are solely responsible. See API Security.

API-key authentication and the shared principal abstraction. Designed so future JWT/OIDC schemes drop in additively.

Includes: AddTraxApiKeyAuth, TraxPrincipal, ITraxPrincipalResolver, ApiKeyDefaults, ApiKeyAuthenticationOptions, TraxAuthClaimTypes.

API Audit (API)

NO WARRANTY. Trax auth is plumbing, not a security product. You are solely responsible. See API Security.

Request-level audit pipeline for Trax GraphQL hosts. Bounded channel, background batch writer, pluggable sink and redactor.

Includes: AddAudit, TraxAuditEntry, ITraxAuditSink, ITraxAuditRedactor, TraxAuditOptions.

Testing

The test-support packages for your own test projects.

Includes: Trax.Core.Testing (HygieneGuardFixture, RepoConventionGuardFixture, VocabularyGuards, ForeignVocabulary, ArchitectureGuardOptions, GuardResult).