@brushy/di/core on the server and @brushy/di/react on the client.
See also: Migration v2 · Server · Best Practices
Quick rule
- Pick your runtime (web, mobile, server, full stack).
- Install the minimum package.
- Add optional packages only if you need them (
monitor,otel).
Which package to install first
Copy the command for your stack. Full stack / Next.jsPublished packages (v2)
Umbrella - core + react + monitor + otelImports (umbrella)
Imports by runtime
Express, Fastify, Nest, API routesRecipes by stack
React web
React Native
Same install and provider pattern as web. Metro resolves thereact-native field automatically.
useInjectComponent shows a default error UI with DOM elements on web. On React Native, register a platform renderer once at bootstrap (otherwise UI is null and errors still log to console.error):
Express
Fastify
Fastify is not Connect-compatible. Wrap each request withrunInRequestScope:
runInRequestScopeAsync in async handlers. Full patterns: Server Utilities.
Next.js (App Router)
runInRequestScopeAsync.
Next: Server - Next.js App Router example
Backend-only (no React)
Optional add-ons
Install only when needed:Next steps
- Container - registration and lifecycles
- Server - request scope, Express, Next.js
- Best Practices - tokens, scopes, testing
- Migration v2 - package split and imports