# Function createHandler

- createHandler<R extends Registry<any>>(
  registry: R,
  inputConfig?: {
  autoConfigureServerless?:
  | boolean
  | {
  headers?: Record<string, string>;
  maxRunners?: number;
  metadata?: Record<string, unknown>;
  minRunners?: number;
  requestLifespan?: number;
  runnersMargin?: number;
  slotsPerRunner?: number;
  url?: string;
  };
  basePath?: string;
  defaultServerPort?: number;
  disableActorDriver?: boolean;
  disableDefaultServer?: boolean;
  disableMetadataLookup?: boolean;
  encoding?: "json"
  | "cbor"
  | "bare";
  endpoint?: string;
  fetch?: ExportedHandlerFetchHandler<{ RIVET: Client<any> }, unknown>;
  headers?: Record<string, string>;
  inspector?: {
  defaultEndpoint?: string;
  enabled?: boolean | { actor?: boolean; manager?: boolean };
  token?: (...args: unknown[]) => string;
  };
  logging?: {
  baseLogger?: Logger;
  level?: | "fatal"
  | "error"
  | "warn"
  | "info"
  | "debug"
  | "trace"
  | "silent";
  };
  managerPath?: string;
  maxIncomingMessageSize?: number;
  namespace?: string;
  noWelcome?: boolean;
  overrideServerAddress?: string;
  runEngine?: boolean;
  runEngineVersion?: string;
  runnerKey?: string;
  runnerKind?: "serverless"
  | "normal";
  runnerName?: string;
  token?: string;
  totalSlots?: number;
  },
  ): Handler

  #### Type Parameters

  - R extends Registry<any>

  #### Parameters

  - registry: R
  - `Optional` inputConfig: {
    autoConfigureServerless?:
    | boolean
    | {
    headers?: Record<string, string>;
    maxRunners?: number;
    metadata?: Record<string, unknown>;
    minRunners?: number;
    requestLifespan?: number;
    runnersMargin?: number;
    slotsPerRunner?: number;
    url?: string;
    };
    basePath?: string;
    defaultServerPort?: number;
    disableActorDriver?: boolean;
    disableDefaultServer?: boolean;
    disableMetadataLookup?: boolean;
    encoding?: "json"
    | "cbor"
    | "bare";
    endpoint?: string;
    fetch?: ExportedHandlerFetchHandler<{ RIVET: Client<any> }, unknown>;
    headers?: Record<string, string>;
    inspector?: {
    defaultEndpoint?: string;
    enabled?: boolean | { actor?: boolean; manager?: boolean };
    token?: (...args: unknown[]) => string;
    };
    logging?: {
    baseLogger?: Logger;
    level?: "fatal"
    | "error"
    | "warn"
    | "info"
    | "debug"
    | "trace"
    | "silent";
    };
    managerPath?: string;
    maxIncomingMessageSize?: number;
    namespace?: string;
    noWelcome?: boolean;
    overrideServerAddress?: string;
    runEngine?: boolean;
    runEngineVersion?: string;
    runnerKey?: string;
    runnerKind?: "serverless"
    | "normal";
    runnerName?: string;
    token?: string;
    totalSlots?: number;
    }

    - ##### `Optional` autoConfigureServerless?:
      | boolean
      | {
      headers?: Record<string, string>;
      maxRunners?: number;
      metadata?: Record<string, unknown>;
      minRunners?: number;
      requestLifespan?: number;
      runnersMargin?: number;
      slotsPerRunner?: number;
      url?: string;
      }

    - ##### `Optional` basePath?: string

    - ##### `Optional` defaultServerPort?: number

    - ##### `Optional` disableActorDriver?: boolean

    - ##### `Optional` disableDefaultServer?: boolean

    - ##### `Optional` disableMetadataLookup?: boolean

    - ##### `Optional` encoding?: "json" | "cbor" | "bare"

    - ##### `Optional` endpoint?: string

    - ##### `Optional` fetch?: ExportedHandlerFetchHandler<{ RIVET: Client<any> }, unknown>

    - ##### `Optional` headers?: Record<string, string>

    - ##### `Optional` inspector?: {
      defaultEndpoint?: string;
      enabled?: boolean | { actor?: boolean; manager?: boolean };
      token?: (...args: unknown[]) => string;
      }

    - ##### `Optional` logging?: {
      baseLogger?: Logger;
      level?: "fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent";
      }

    - ##### `Optional` managerPath?: string

      Path that the Rivet manager API will be mounted.

    - ##### `Optional` maxIncomingMessageSize?: number

    - ##### `Optional` namespace?: string

    - ##### `Optional` noWelcome?: boolean

    - ##### `Optional` overrideServerAddress?: string

    - ##### `Optional` runEngine?: boolean

    - ##### `Optional` runEngineVersion?: string

    - ##### `Optional` runnerKey?: string

    - ##### `Optional` runnerKind?: "serverless" | "normal"

    - ##### `Optional` runnerName?: string

    - ##### `Optional` token?: string

    - ##### `Optional` totalSlots?: number

  #### Returns Handler

  - Defined in rivetkit-typescript/packages/cloudflare-workers/src/handler.ts:32