> For the complete documentation index, see [llms.txt](https://cjays-organization.gitbook.io/nexora.ts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cjays-organization.gitbook.io/nexora.ts/getting-started/configuration.md).

# Configuration

All bot configuration goes through type-safe `defineConfig()`.

```ts
import { defineConfig } from '@nexora.ts/config';

export default defineConfig({
  bot: {
    token: process.env.DISCORD_TOKEN!,
    clientId: process.env.DISCORD_CLIENT_ID!,
    guildIds: process.env.DISCORD_GUILD_ID
      ? [process.env.DISCORD_GUILD_ID]
      : undefined,
  },
  database: {
    provider: 'postgresql', // or 'sqlite'
    url: process.env.DATABASE_URL!,
  },
  // Optional — reserved for future public admin UI (not part of the shipped Studio)
  dashboard: {
    enabled: false,
    port: 3000,
    secret: process.env.DASHBOARD_SECRET,
  },
  auth: {
    clientId: process.env.DISCORD_CLIENT_ID!,
    clientSecret: process.env.DISCORD_CLIENT_SECRET!,
    redirectUri: process.env.OAUTH_REDIRECT_URI!,
  },
  logger: {
    level: 'info',
    console: { mode: 'pretty' }, // 'pretty' | 'compact' | 'json'
    file: { enabled: true, path: './logs/nexora.log' },
    liveStream: true,
  },
  plugins: {
    tickets: { enabled: true },
  },
  // Notify in the console when a newer @nexora.ts/core is on npm (default: true)
  updateCheck: true,
});
```

## Environment overrides

Importing `@nexora.ts/config` loads `.env` via `loadEnv()`. Scaffold scripts also pass `--env-file=.env`.

`@nexora.ts/config` can merge common `NEXORA_*` env vars (token, database URL, log level, dashboard secret). Prefer keeping secrets in `.env`, never in git.

Set `NEXORA_UPDATE_CHECK=0` to disable the startup update notice without changing config.

## Validation

Use `validateConfig()` for runtime Zod checks when loading untrusted config sources.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cjays-organization.gitbook.io/nexora.ts/getting-started/configuration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
