Skip to main content

Installation

Get started with Effect by installing the package in your TypeScript project.
Effect v4.0.0-beta is currently in beta. The package is production-ready, but the version number indicates that minor API changes may occur before the stable 4.0.0 release.

Install Effect

Install the effect package using your preferred package manager:
npm install effect
The current beta version is 4.0.0-beta.21.

Requirements

Effect requires the following minimum versions:
  • TypeScript: 5.9 or higher
  • Node.js: 18.0 or higher (for Node.js environments)
Effect also works in Bun, Deno, browsers, and other JavaScript runtimes. The library is platform-agnostic at its core.

TypeScript configuration

Ensure your tsconfig.json has strict mode enabled for the best type-safety:
tsconfig.json
{
  "compilerOptions": {
    "strict": true,
    "module": "ESNext",
    "moduleResolution": "bundler",
    "target": "ES2022"
  }
}

Project setup

1

Create a new project

If you’re starting from scratch, create a new directory and initialize a package.json:
mkdir my-effect-app
cd my-effect-app
npm init -y
2

Install TypeScript

Add TypeScript as a dev dependency:
npm install --save-dev typescript
3

Install Effect

Install the Effect library:
npm install effect
4

Configure TypeScript

Create a tsconfig.json file with the recommended settings:
{
  "compilerOptions": {
    "strict": true,
    "module": "ESNext",
    "moduleResolution": "bundler",
    "target": "ES2022",
    "outDir": "./dist",
    "rootDir": "./src"
  },
  "include": ["src"]
}
5

Create your first file

Create a src/index.ts file and you’re ready to start coding!

Package structure

Effect is distributed as a single package with multiple entry points:
  • effect - Core functionality (Effect, Schema, Layer, etc.)
  • effect/testing - Testing utilities
  • effect/unstable/ai - AI and language model integrations
  • effect/unstable/cli - CLI application utilities
  • effect/unstable/cluster - Distributed cluster capabilities
  • effect/unstable/http - HTTP client
  • effect/unstable/httpapi - HTTP API server
  • effect/unstable/observability - Observability exports (OTLP, etc.)
  • effect/unstable/process - Child process management
  • effect/unstable/sql - SQL database integrations
  • And many more…
Modules under unstable/ are stable in functionality but may have API changes as they graduate to the stable API surface.

Platform packages

For Node.js or Bun-specific functionality, you may want to install platform packages:
npm install @effect/platform-node
These provide platform-specific implementations for:
  • File system operations
  • HTTP server and client
  • Command line interface utilities
  • Process management
  • Runtime utilities

Verify installation

Create a simple test file to verify everything is working:
src/test.ts
import { Effect } from "effect"

const program = Effect.gen(function*() {
  yield* Effect.log("Effect is installed and working!")
  return "success"
})

Effect.runPromise(program).then(console.log)
Run it with:
npx tsx src/test.ts
You should see the log message and “success” output.

Next steps

Now that Effect is installed, continue to the quick start guide to build your first program:

Quick start

Build your first Effect program

Build docs developers (and LLMs) love