@interlace/serverless

Compatibility Helpers

Typed config shims for popular community plugins during migration.

Overview

The compat module provides typed configuration helpers for popular community plugins. Use these as a bridge while you migrate to native @interlace plugins.

import { defineConfig, compat } from '@interlace/serverless-devkit';

export default defineConfig({
  service: 'my-api',
  provider: { name: 'aws', runtime: 'nodejs20.x' },
  custom: {
    // Typed — catches typos and invalid values
    ...compat.apiGatewayCaching({
      enabled: true,
      clusterSize: '0.5',
      ttlInSeconds: 300,
    }),

    ...compat.domainManager({
      domainName: 'api.example.com',
      basePath: '',
    }),

    ...compat.prune({
      automatic: true,
      number: 3,
    }),
  },
});

Available Helpers

HelperCommunity PluginStatus
compat.apiGatewayCaching()serverless-api-gateway-cachingMigrate to @interlace/serverless-api-gateway-caching
compat.domainManager()serverless-domain-managerCompat only
compat.prune()serverless-prune-pluginCompat only

Migration Path

Once you're ready to switch to the native @interlace plugin:

  1. Replace compat.apiGatewayCaching() with interlaceCaching config
  2. Swap the plugin in your plugins array
  3. See the migration guide for details

On this page