---
title: defineConfig
description: "Declare the config of an Instance: the default export of `jr2.config.ts`."
---

# `defineConfig`

Function, in `@jr2/orchestrator/src/config.ts`. It is an export of `@jr2/orchestrator`, on the [Authoring surface](../authoring-surface.md) page, in Config.

```ts
function defineConfig(c: JR2Config): JR2Config
```

Declare the config of an Instance: the default export of `jr2.config.ts`. It gives back the
object that you pass. Its only work is to check that object against [`JR2Config`](type-jr2config.md) where you
write it, at every depth, a misspelled key included. `jr2 up` typechecks the file before it
converges.

**Parameters**

- `c`: The Instance's config. See [`JR2Config`](type-jr2config.md) for every field.

**Returns**: The same object.

**Example**

```ts
import { defineConfig } from "@jr2/orchestrator";

export default defineConfig({
  name: "my-instance",
  secrets: [{ name: "ANTHROPIC_API_KEY", value: process.env.ANTHROPIC_API_KEY }],
  git: { credentials: [{ match: "github.com/you/", token: "GITHUB_TOKEN" }] },
});
```

**See also**

- [jr2.config.ts](../config.md)
- [Create an Instance](../../get-started/create-an-instance.md)
- [ADR-0050: What code names, config declares; what the CLI names, discovery finds](../decisions/0050-what-code-names-config-declares-what-the-cli-names-discovery-finds.md)
