effect-ts
Effect-TS
Effect is a TypeScript library for building production-grade software with typed errors, structured concurrency, dependency injection, and built-in observability.
Version Detection
Before writing Effect code, detect which version the user is on:
# Check installed version
cat package.json | grep '"effect"'
- v4.x (recommended, the direction Effect is heading):
Context.Service,Effect.catch,Effect.forkChild,Schema.TaggedErrorClass - v3.x (stable, still common in production):
Context.Tag,Effect.catchAll,Effect.fork,Data.TaggedError
Note: v4 beta briefly used a
ServiceMapmodule, renamed back toContexton 2026-04-07 (PR #1961). If you seeServiceMap.*in any doc or older beta code, it is the currentContext.*. Both v3 and v4 importContextfrom"effect"; the exports inside differ (Context.Servicein v4 vsContext.Tagin v3).
Prefer v4 for new projects - it's where Effect is going. In an existing codebase, match the installed version: don't rewrite v3 code in v4 syntax unless asked. If the version is genuinely unclear, default to v4 and say so. v4 is still in beta, so pin an exact version (4.0.0-beta.x) and expect occasional API churn.