Skip to main content
This guide helps you choose the right packages and setup order for a new project. Express, Fastify, Next.js, and React Native all use the same entrypoints: @brushy/di/core on the server and @brushy/di/react on the client. See also: Migration v2 · Server · Best Practices

Quick rule

  1. Pick your runtime (web, mobile, server, full stack).
  2. Install the minimum package.
  3. Add optional packages only if you need them (monitor, otel).

Which package to install first

Copy the command for your stack. Full stack / Next.js
React web
Granular install (without umbrella):
React Native
Granular install:
Express
Fastify
Script / worker / library (no React)
API + React frontend in the same project
Observability (optional)

Published packages (v2)

Umbrella - core + react + monitor + otel
Core - Node, browser, RN without React hooks
React - web and React Native
Monitor
OpenTelemetry

Imports (umbrella)

Imports by runtime

Express, Fastify, Nest, API routes
Next.js Route Handlers / RSC
React web, React Native, Next client
Full stack (umbrella)
See Package entrypoints for the package split rationale.

Recipes by stack

React web

Next: React Hooks

React Native

Same install and provider pattern as web. Metro resolves the react-native field automatically.
Important: In dev, 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):
Next: Component Injection

Express

Next: Server Utilities

Fastify

Fastify is not Connect-compatible. Wrap each request with runInRequestScope:
For production, prefer runInRequestScopeAsync in async handlers. Full patterns: Server Utilities.

Next.js (App Router)

Client Components
Route Handlers / server
React Server Components
Do not rely on Next.js Edge middleware for Node ALS request scope in Route Handlers - bind scope inside the handler with runInRequestScopeAsync. Next: Server - Next.js App Router example

Backend-only (no React)


Optional add-ons

Install only when needed:

Next steps