Overview
API reference for the NitroStack TypeScript and Python SDKs
This section documents the public API of both NitroStack SDKs: every decorator, the pipeline interfaces, the execution context, and the CLI commands. Each page shows TypeScript first, with the Python equivalent in a tab wherever one exists. Pick a language once and every tab on the site follows it.
TypeScript and Python at a glance
Both SDKs share the same mental model (modules, controllers, providers, and a request pipeline), but the APIs follow each language's conventions. Don't copy TypeScript examples into a Python project, or the other way around.
| TypeScript | Python | |
|---|---|---|
| Package | @nitrostack/core | nitrostack (pip install nitrostack) |
| CLI | nitrostack-cli (@nitrostack/cli) | nitrostack-py (also python -m nitrostack.cli.main) |
| Decorators | PascalCase: @Tool, @Module, @Injectable | snake_case: @tool, @module, @injectable |
| Input schemas | Zod (z.object(...)) | Pydantic v2 BaseModel as input_schema |
| Dependency injection | Constructor parameter types | @injectable(deps=[ServiceA, ServiceB]) + constructor args |
| Pipeline | @UseGuards / @UseMiddleware / @UseInterceptors / @UsePipes / @UseFilters | use_guards / use_middleware / use_interceptors / use_pipes / use_filters |
| Widgets | Next.js app in src/widgets | Static HTML under widgets/out/{route}.html + @widget |
| Build step | nitrostack-cli build | None (nitrostack-py has no build command) |
Reference
Decorators
Tools, resources, prompts, modules, pipeline, caching, and widgets.
Guards
Allow or reject a call before your handler runs.
Middleware
Wrap every call for logging, tracing, and timing.
Interceptors
Run around the handler and reshape its result.
Pipes
Transform and validate input.
Exception Filters
Turn errors into consistent responses.
Execution Context
The object every handler receives.
CLI Commands
nitrostack-cli and nitrostack-py commands.
