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

# Configuration

> Admin-level service settings reference

Separate from user credentials, services can define admin-level configuration settings. These are configured once by an admin and shared across all users of the service.

## Defining settings

```typescript theme={null}
const SERVICE_CONFIGURATION_OPTIONS = [
  {
    key: "baseUrl",
    description: "API base URL",
    type: "url",
    required: false,
    defaultValue: "https://api.example.com",
  },
  {
    key: "apiVersion",
    description: "API version to use",
    type: "select",
    required: true,
    defaultValue: "v2",
    options: JSON.stringify([
      { value: "v1", label: "Version 1" },
      { value: "v2", label: "Version 2" },
    ]),
  },
] as const;
```

## Setting fields

| Field          | Required | Description                                                    |
| -------------- | -------- | -------------------------------------------------------------- |
| `key`          | Yes      | Unique identifier for the setting                              |
| `description`  | Yes      | Label shown to the admin                                       |
| `type`         | Yes      | Input type: `text`, `password`, `url`, or `select`             |
| `required`     | Yes      | Whether the field is required                                  |
| `defaultValue` | No       | Default value                                                  |
| `options`      | No       | JSON-stringified array of `{ value, label }` for `select` type |

## Accessing settings

Settings are available in the service context:

```typescript theme={null}
createClient(context: AuthenticatedServiceContext<Settings, CustomAuth>) {
  const baseUrl = context.serviceConfig.settings.baseUrl;
  return new ApiClient({ baseUrl });
}
```
