Installation
The core package has no runtime dependencies and works with SWC and TypeScript's decorator support.
Requirements
TypeScript 5.0 or higher
SWC or TypeScript compiler with decorator support enabled
Scaffold an app (recommended)
The fastest path is the app CLI:
That writes a tsconfig.json with @di-framework/tsc (plugins), @di-framework/cli, and sample src/index.ts (ttsc and TypeScript 7+ come with @di-framework/tsc). Scripts call di-framework build/di-framework check (which run ttsc). Runtime parameter checks are injected on emit (bun run build). See CLI for check/build and Runtime type checks.
Install the Package
or with yarn:
or with bun:
Configuration
TypeScript Configuration
Ensure your tsconfig.json has the following settings:
Apps from di-framework init also include plugins: [{ "transform": "@di-framework/tsc" }] and emit via ttsc. For manual setup of runtime parameter checks, see Runtime type checks.
SWC Configuration
If you're using SWC, ensure your .swcrc has decorator support enabled:
No Additional Dependencies
The decorators are fully integrated with SWC's native support - no need for reflect-metadata or any other polyfill. This keeps your bundle size small and your dependencies minimal.
Import paths and container singleton
Always import from the scoped package @di-framework/core/* to ensure a single global container instance. Mixing different import IDs (e.g., di-framework/* or relative paths to sources) can load a second copy of the library and create a second global container instance.
Correct:
Avoid:
Verify Installation
Create a simple test file to verify the installation:
Run the file with your TypeScript runner (ts-node, tsx, bun, etc.):
Version 6 package sources
Version 6 publishes from several repositories. Core application packages (@di-framework/core, @di-framework/http, and the other packages in the core monorepo) publish at 6.x from di-framework/di-framework. AI packages, the operated platform, bindings, and first-party CLI extensions publish from their own repositories at 6.x:
Package | Repository |
|---|---|
| |
| |
| |
|
Install platform and AI extensions with di-framework extensions install platform and di-framework extensions install ai. Platform commands use the platform group (including platform cluster for managed Pulumi targets). See AI CLI and Platform. Sample apps live in di-framework/examples, including platform-examples for a single-command local platform deploy. This is distinct from kube examples-apps, its application verification workspace.
@di-framework/platform 6.0.7 includes blobstore, egress, tenant kubeconfigs, and the HTTP gateway. di-framework-kube still installs @di-framework/[email protected] unless you pass --platform-package. See Kubernetes with di-framework-kube.
Optional Packages
The core package stands alone. Companion packages add data access, HTTP, GraphQL, events, sockets, RPC, configuration, authentication, and AI support:
Package | Docs |
|---|---|
| |
| Runtime type checks (default in |
| Biome plugins — GritQL rules for framework mistakes |
| Schema codegen — |
| Repositories, including the wasmCloud PostgreSQL codec |
| |
| |
| |
| Queues — durable jobs (latest / EAP) |
| Actors — local virtual actors (latest / EAP) |
| |
| |
| |
| |
| |
| |
| Agent Skills — |
| Native service bindings — PostgreSQL, key-value, blobstore, messaging, config, secrets, and outgoing HTTP |
| Platform — WASI 0.3 build, development, and deployment extension |
| AI CLI — |
| Shared Pulumi platform — infrastructure, tenant isolation, and Redis, NATS, blobstore, PostgreSQL, and egress backing services, tenant kubeconfigs, and the HTTP gateway used by kube and the platform CLI |
| Cloud Foundry — |
| Cloudflare Workers — binding discovery, wrangler config, and DI injection |
For a local Kubernetes platform and live service-binding examples, use the separate di-framework-kube CLI. It requires Node.js, npm, and Pulumi, and installs the shared platform package from npm. Its example workspace links DI Framework 6 with @di-framework/bindings and @di-framework/cli-plugin-platform for builds and di-framework platform deploy. Published applications use the same packages at @^6.
Next Steps
Now that you have the framework installed, learn how to use it:
Quick Start - Learn the basics with simple examples
CLI - Complete command tree, output contract, and package ownership
API Reference - Complete API documentation