Skip to content

Packages

Every opt-in crate the NestRS framework ships — grouped by concern, with Cargo names, umbrella features, and links to the docs.

NestRS installs as one dependency. Each concern — HTTP, GraphQL, queues, authorization, observability — is a Cargo feature you enable when the binary needs it, and a feature you leave off is code you never compile. A headless worker compiles no HTTP stack; an MCP-only assistant compiles no GraphQL schema.

Terminal window
cargo add nest-rs --features http,seaorm,graphql

Undecided? --features full turns everything on — narrow it later without moving a single use. Either way nest_rs::prelude::* covers the decorators and types an app reaches for daily.

The table below is a menu of features, not a list of crates to line up.

CrateCargo featureWhat it isDocs
nest-rs(always)Re-exports core + optional surface crates; nest_rs::prelude for the common case. One version to bump, and the only framework line your manifest needs — a decorator’s expansion resolves through itGetting started
nest-rs-core(via umbrella)DI container, #[module], lifecycle hooks, boot-time access graphFundamentals

Default features: http, config — every other surface crate is opt-in via features = [...].

Each transport is a module you import in AppModule. HTTP-shaped surfaces (GraphQL, OpenAPI, MCP, WebSocket gateways) mount on the same HttpTransport — one port, one TLS config.

CrateCargo featureWhat it isDocs
nest-rs-httphttpHTTP transport — controllers, routes, extractors, built on poemHTTP
nest-rs-graphqlgraphqlResolver discovery, schema composition, async-graphql integrationGraphQL
nest-rs-wswsWebSocket gateways — self-mount on the HTTP transportWebSockets
nest-rs-openapiopenapiOpenAPI 3 document + bundled Swagger UI from the route tableOpenAPI
nest-rs-mcpmcpModel Context Protocol server over HTTPMCP
CrateCargo featureWhat it isDocs
nest-rs-databasedatabaseORM-agnostic executor seam — ambient request/job context any driver implementsDatabase · Writing a driver
nest-rs-seaormseaormFirst-class SeaORM integration — SeaOrmDatabaseModule, Repo, transactions, dataloadersDatabase
nest-rs-resourceresource#[expose] — one entity declaration for GraphQL + OpenAPI + CRUD helpersCRUD · Relations
nest-rs-storagestorageS3-compatible object storage — injectable Storage, presigned URLs, via object_storeStorage

Authentication answers who; authorization answers what they may do. Product-specific strategies and policies live in your features crate — these crates are the engine.

CrateCargo featureWhat it isDocs
nest-rs-authnauthnJWT service, pluggable Strategy, AuthnGuardAuthentication
nest-rs-authzauthzAbility-based authorization — access gate, row-level filter, response maskingAuthorization
nest-rs-oauth-serveroauth-serverThe OAuth 2.0 authorization server role — RFC 6749 §5.2 token-endpoint errors, §2.3.1 client authenticationSplit deployment
nest-rs-oauth-clientoauth-clientThe OAuth 2.0 client role — Authorization Code flow with PKCE against someone else’s authorization serverOAuth 2.0
nest-rs-oauth-resourceoauth-resourceRFC 9728 protected-resource metadata — the well-known document, and the 401 challenge pointerSplit deployment
nest-rs-socialsocialOpen SocialProvider contract — first-party GitHub/Google, third-party providers via the same seamSocial login

Cross-cutting layers shared across HTTP, GraphQL, and WebSockets. Bind them globally on App::builder() or per controller / resolver / gateway.

CrateCargo featureWhat it isDocs
nest-rs-guardsguardsThe Guard trait — gates access before the handler runsGuards
nest-rs-pipespipesStateless input validation and transformation at the edgePipes
nest-rs-interceptorsinterceptorsWrap handler execution — logging, transactions, ability scopeInterceptors
nest-rs-filtersfiltersMap inner errors to transport responsesException filters
nest-rs-exception-filtersexception-filtersTyped exception filters — catch one concrete error typeException filters
CrateCargo featureWhat it isDocs
nest-rs-queuequeueBackend-agnostic job contract + #[process] registryQueue
nest-rs-redisredisRedis-backed producer and worker (via oxana)Queue wiring
nest-rs-schedulescheduleCron-style scheduled jobs — #[scheduled] + ScheduleModuleSchedule
nest-rs-eventseventsTyped in-process event bus — #[listeners] / #[on_event]Events
nest-rs-workerworkerAmbient job context seam for off-request transportsQueue · Writing a driver
CrateCargo featureWhat it isDocs
nest-rs-configconfigNamespaced env + file config bound to typed #[config] structsConfiguration
nest-rs-healthhealthKubernetes-style liveness / readiness / startup probesHealth
nest-rs-throttlerthrottlerPer-route rate limiting via ThrottlerGuardThrottler
nest-rs-opentelemetryopentelemetryLogs, traces, metrics, W3C propagation, OTLP exportOpenTelemetry
nest-rs-server-timingserver-timingW3C Server-Timing response header (independent of OTel)Server-Timing
CrateCargo featureWhat it isDocs
nest-rs-cli(binary: nestrs)Scaffold workspaces, generate features, project health checksCLI
nest-rs-testingtestingIn-process harness — boot the real DI graph, drive HTTP/GraphQL/MCP without a socketTesting

These are composition patterns, not separate crates — they show which packages a deployable usually pulls in.

Binary rolePackages you typically import
REST + OpenAPI APIhttp, openapi, config, seaorm, authn, authz, health
GraphQL APIhttp, graphql, config, seaorm, authn, authz
WebSocket live servicehttp, ws, config, seaorm, authn, authz
Queue workerqueue, redis, schedule, seaorm, config
MCP assistanthttp, mcp, config, authn, authz
Token issuerhttp, config, seaorm, authn

See The Publish workspace for five real apps that follow these profiles.

Internal macro crates (nest-rs-*-macros, nest-rs-codegen) implement the decorators — you never add them as direct dependencies; the surface crate re-exports what you need. For a decorator index see Decorators.

Your product’s features crate holds domain modules (entities, services, controllers per transport). It is workspace-local and not published to crates.io — copy crates/features/src/users/ as the exemplar.

Turn on its feature. There is one framework line, and adding a transport never adds a second — this is the real apps/api/Cargo.toml (REST + GraphQL + DB + authz), trimmed to the framework line:

apps/api/Cargo.toml (from the demo)
[dependencies]
nest-rs = { workspace = true, features = [
"http", "config", "seaorm", "graphql", "openapi", "authn", "authz", "health",
] }

In a fresh project the same step is cargo add nest-rs --features <capability> — exactly what each module’s adoption page shows. Then import the matching modules in AppModule — for example HttpModule::for_root(...), SeaOrmModule::for_root(...), GraphqlModule, AuthzModule. The Publish workspace and Getting started walk through a full composition.

A decorator is a procedural macro, and its expansion resolves paths against your crate’s extern prelude. NestRS decorators root theirs at ::nest_rs::<concern>::…, which that single entry reaches — so the feature list is the install. Nothing a decorator expands into is a line you write.

Get the dependency wrong and the compiler says so in your own terms:

Terminal window
error: this nestrs decorator expands into the framework, which this crate
cannot reach. Add to Cargo.toml:

The message does not stop there — it ends on the complete nest-rs = { … } line to paste, carrying the version the decorator that failed to resolve was built from and the features it needs. That line is elided here on purpose: printed by the compiler it is always current, and written on this page it would go stale at the next release.

Get the feature wrong — the likelier mistake, since the dependency is already there — and the diagnostic is rustc’s own. A missing feature reads as a missing item, with a note telling you which:

Terminal window
error[E0433]: failed to resolve: could not find `seaorm` in `nest_rs`
|
= note: found an item that was configured out
= note: the item is gated behind the `seaorm` feature

Add the feature named in the note to the nest-rs line — never a second crate.

The nest-rs-* crates stay published and keep their names — they are separate compilation units, which is what makes an unused capability free. They are not the entry point, and renaming the nest-rs dependency is unsupported: the same limit tokio has, for the same reason.

Crates your own code names. A job payload deriving serde::Serialize, an indicator returning anyhow::Result, an entity written against sea-orm — those are yours, and hiding them behind a re-export would cost you their feature flags and a truthful cargo tree. No Rust framework hides them; NestRS does not either.

GraphQL used to be the one exception, and no longer is: #[operations] wraps async-graphql’s #[Object], but it now pins that expansion to the framework’s own re-export, so nest-rs --features graphql alone compiles a resolver. async-graphql returns to the rule above — yours when your code names it, which for its types you can avoid entirely with use nest_rs::graphql::async_graphql::{Context, Result};, and for its derives you cannot, exactly as for serde.