> ## Documentation Index
> Fetch the complete documentation index at: https://docs.overlayed.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# OverlayedConfig

> The configuration for the overlayed.config.ts file

## Usage

```ts theme={null}
import { defineConfig } from "@overlayed/app";

export default defineConfig({
	// ...
});
```

The following properties are available on the `OverlayedConfig` interface.

## applicationId

Your Overlayed application ID, from the [Overlayed Dashboard](https://overlay.dev/settings/applications). Must be a
valid ULID. `defineConfig` throws at load time if it isn't.

* **Type**

  ```typescript theme={null}
  applicationId: string;
  ```

## app

The bundle config for your Electron app.

* **Type**

  ```typescript theme={null}
  app: BundleAppConfig;
  ```

## site

The optional bundle config for your site.

* **Type**

  ```typescript theme={null}
  site?: BundleSiteConfig;
  ```

## bundle config

Shared fields for both `BundleAppConfig` and `BundleSiteConfig`.

* **Type**

  ```typescript theme={null}
  interface BundleConfigBase {
  	/**
  	 * The base directory to bundle from.
  	 *
  	 * @default location of the overlayed.config.ts file
  	 */
  	baseDir?: string;
  	/**
  	 * String or array of string glob patterns to bundle.
  	 *
  	 * `package.json` is always included.
  	 */
  	include: MaybeArray<string>;
  	/**
  	 * String or array of string glob patterns to exclude from the bundle.
  	 *
  	 * `/installer` is always excluded.
  	 */
  	exclude?: string | string[];
  }

  interface BundleSiteConfig extends BundleConfigBase {}
  ```

* **Details**
  * `baseDir` (optional): The base directory to bundle from. `include` and `exclude` patterns are resolved relative to
    it. Defaults to the location of the `overlayed.config.ts` file.
  * `include` (required): String or array of string [glob](https://www.npmjs.com/package/glob) patterns to include in
    the bundle. `package.json` is always included, and the app bundle always includes `node_modules/@overlayed/app`.
  * `exclude` (optional): String or array of string glob patterns to exclude from the bundle. The `overlayed.config.ts`
    file is always excluded from both bundles. The app bundle additionally excludes any `installer` folder; the site
    bundle does not, so exclude it explicitly there if needed.

## app bundle config

`BundleAppConfig` adds fields used only when building the app bundle - these control how the installed versions of
`@overlayed/app` and `@overlayed/electron` are resolved for the release.

* **Type**

  ```typescript theme={null}
  interface BundleAppConfig extends BundleConfigBase {
  	/**
  	 * Relative path to the `node_modules` directory used when resolving installed package versions.
  	 *
  	 * @default "node_modules"
  	 */
  	nodeModulesDir?: string;

  	/**
  	 * Override the default version resolution for `@overlayed/app` and `@overlayed/electron`.
  	 * Receives the package name and the resolved base directory, and should return the semver version string.
  	 */
  	resolvePackageVersion?: (packageName: string, cwd: string) => string;
  }
  ```

* **Details**
  * `nodeModulesDir` (optional): Where to look for installed package versions, relative to the app `baseDir`. Set this
    if your dependencies live somewhere other than `./node_modules` (e.g. a hoisted monorepo root).
  * `resolvePackageVersion` (optional): Fully override how the `@overlayed/app` and `@overlayed/electron` versions are
    determined. Return the semver string for the given package name.

## resolveCommitHash

Override the default commit hash resolution (`git rev-parse HEAD`) attached to each upload. Return `undefined` to omit
the commit hash entirely - useful when bundling outside a git checkout.

* **Type**

  ```typescript theme={null}
  resolveCommitHash?: () => string | undefined;
  ```

## debug

Debug mode is enabled by passing the `--debug` flag to the CLI (`overlayed bundle --debug`), not by this field. When
active:

* Extra logs will occur

* The bundles will be written to `.overlayed/tmp/` as a zip **instead of** uploading to the Overlayed platform

* **Type**

  ```typescript theme={null}
  debug?: boolean;
  ```

* **Default:** `false`
