Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/eersnington/sideffect/llms.txt

Use this file to discover all available pages before exploring further.

Installing Sideffect adds the core library and its required peer dependency, Effect. Effect provides the schema primitives (Schema.Struct, Schema.String, and friends) that back Sideffect’s typed step payloads and results. If you are using the Vite-based setup — the recommended path — you will also install @cloudflare/vite-plugin so the workflow auto-discovery plugin has something to wrap. The @cloudflare/workers-types package is optional but strongly recommended for full env type coverage inside step run functions.
Sideffect requires Node.js >= 22.12.0. Make sure your local environment and any CI runners meet this requirement before installing.
1
Install sideffect and effect
2
Install the core package together with its required peer dependency.
3
npm
npm install sideffect effect
yarn
yarn add sideffect effect
pnpm
pnpm add sideffect effect
bun
bun add sideffect effect
4
The minimum supported version of effect is >=4.0.0-beta.75.
5
Install @cloudflare/vite-plugin (Vite users)
6
If you are using the Vite adapter for automatic workflow discovery, add the Cloudflare Vite plugin. It is an optional peer dependency — skip this step if you are using plain Wrangler.
7
npm
npm install --save-dev @cloudflare/vite-plugin
yarn
yarn add --dev @cloudflare/vite-plugin
pnpm
pnpm add --save-dev @cloudflare/vite-plugin
bun
bun add --dev @cloudflare/vite-plugin
8
The minimum supported version is ^1.40.0.
9
Configure TypeScript
10
Sideffect step run functions access Cloudflare bindings through ctx.env, which is typed from your project’s Cloudflare.Env. Add @cloudflare/workers-types to your dev dependencies and reference it in tsconfig.json:
11
npm
npm install --save-dev @cloudflare/workers-types
yarn
yarn add --dev @cloudflare/workers-types
pnpm
pnpm add --save-dev @cloudflare/workers-types
bun
bun add --dev @cloudflare/workers-types
12
Then add the types to your tsconfig.json:
13
{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "Bundler",
    "strict": true,
    "types": ["@cloudflare/workers-types"]
  }
}
14
Alternatively, generate precise types for your specific Worker with wrangler types or augment the global Cloudflare.Env interface in src/env.d.ts.
15
Configure the Vite plugin (Vite users)
16
Wrap the cloudflare plugin with withCloudflareWorkflows in your vite.config.ts. This tells Sideffect to scan your workflow directories and generate bindings automatically at dev and build time.
17
import { cloudflare } from "@cloudflare/vite-plugin";
import { defineConfig } from "vite";
import { withCloudflareWorkflows } from "sideffect/vite";

export default defineConfig({
  plugins: [
    ...withCloudflareWorkflows(cloudflare, {
      workflowPaths: ["src/workflows"],
    }),
  ],
});
18
See the Vite Integration guide for the full list of withCloudflareWorkflows options, including how to merge additional Wrangler config such as Durable Object bindings.

Build docs developers (and LLMs) love