Skip to main content
Build extensions hook into the Trigger.dev build pipeline to customize the build process, the resulting bundle, or the container image that gets deployed. They run during trigger.dev deploy (and during local builds). Common use cases include:
  • Installing system packages (e.g. ffmpeg, chromium) into the deployment image
  • Running Prisma migrations or generating the Prisma client before deploy
  • Copying additional files into the bundle
  • Adding custom esbuild plugins
  • Syncing environment variables from external services

Adding extensions

Extensions are added to the build.extensions array in your trigger.config.ts file.

Using built-in extensions

Install the @trigger.dev/build package as a dev dependency, then import the extensions you need:
npm add -D @trigger.dev/build
trigger.config.ts
import { defineConfig } from "@trigger.dev/sdk";
import { ffmpeg } from "@trigger.dev/build/extensions/core";

export default defineConfig({
  project: "my-project",
  build: {
    extensions: [ffmpeg()],
  },
});

Writing a custom extension

If none of the built-in extensions meet your needs, you can define an extension inline as a plain object:
trigger.config.ts
import { defineConfig } from "@trigger.dev/sdk";

export default defineConfig({
  project: "my-project",
  build: {
    extensions: [
      {
        name: "my-extension",
        onBuildStart: async (context) => {
          console.log("Build is starting!");
        },
        onBuildComplete: async (context, manifest) => {
          console.log("Build complete. Manifest:", manifest);
        },
      },
    ],
  },
});
The extension object supports onBuildStart, onBuildComplete, externalsForTarget, and addLayer hooks that let you fully customize the build pipeline.

Built-in extensions

All built-in extensions are available in the @trigger.dev/build package.
ExtensionImport pathDescription
prismaExtension@trigger.dev/build/extensions/prismaGenerate the Prisma client and include it in your deployment. Supports multiple schemas and engine types.
pythonExtension@trigger.dev/python/extensionExecute Python scripts from your tasks. Installs Python and your requirements into the image.
playwright@trigger.dev/build/extensions/playwrightRun Playwright browsers in your tasks with full browser support.
puppeteer@trigger.dev/build/extensions/puppeteerRun Puppeteer in your tasks. Installs a compatible Chromium browser into the deployment image.
lightpanda@trigger.dev/build/extensions/lightpandaUltra-fast, low-memory headless browser optimized for scraping.
ffmpeg@trigger.dev/build/extensions/coreInstall the FFmpeg binary for audio and video processing.
aptGet@trigger.dev/build/extensions/coreInstall arbitrary system packages using apt-get during the image build.
additionalFiles@trigger.dev/build/extensions/coreCopy additional files from your project into the deployment bundle.
additionalPackages@trigger.dev/build/extensions/coreInstall additional npm packages that aren’t part of your project’s package.json.
syncEnvVars@trigger.dev/build/extensions/coreSync environment variables from Vercel or Supabase at deploy time.
esbuildPlugin@trigger.dev/build/extensions/coreAdd existing or custom esbuild plugins to your build pipeline.
emitDecoratorMetadata@trigger.dev/build/extensions/coreEnable emitDecoratorMetadata for TypeScript decorator support (TypeORM, NestJS).
audioWaveform@trigger.dev/build/extensions/coreInstall the audiowaveform binary for generating waveform data.

Build docs developers (and LLMs) love