Skip to main content

Overview

ff-effect is a utilities package that provides Effect.ts-first wrappers for popular libraries:
  • AI SDK - Effectful wrappers for AI SDK’s generateText, streamText, and tool with automatic callback bridging
  • Drizzle - Type-safe database operations with built-in transaction support
  • Inngest - Background job orchestration with Effect-based function handlers
  • oRPC - RPC procedures backed by Effect
All integrations preserve Effect’s composability, type-safety, and structured concurrency while making it seamless to use these libraries in an Effect-first codebase.

Installation

Peer Dependencies

Depending on which integrations you use, install the corresponding peer dependencies:

Core Utilities

The package exports three core utilities:

extract

Extract services from an Effect function to move dependencies up the stack. This is particularly useful when building service containers that expose methods requiring services.

runPromiseUnwrapped

Run an Effect as a Promise, automatically unwrapping errors from Cause to throw them directly.

wrapClient

Wrap any Promise-based client with consistent Effect error handling.

Integration Modules

Each integration is available under a separate export path:
Explore the individual integration pages to learn more:

Type Safety

All utilities preserve full type inference and provide compile-time safety:
  • Service dependencies are tracked in the R type parameter
  • Errors are represented in the E type parameter
  • Success values flow through the A type parameter

Next Steps

extract

Learn how to extract service dependencies

AI SDK

Use AI SDK with Effect callbacks

Drizzle

Type-safe database operations

Inngest

Background job orchestration