---
title: Configuration reference
description: Configure Flagpole's process and Drift's embedded store with their supported options.
url: https://pr-15-c0fdf0ef9f59.thally.app/customization
---

# Configuration reference

Configure Flagpole's process and Drift's embedded store with their supported options.

## Flagpole environment variables

Flagpole reads configuration when the process starts. Every variable is
optional, but an exposed deployment should always set an API token.

| Variable | Default | Purpose |
| --- | --- | --- |
| `PORT` | `3333` | HTTP port. |
| `FLAGPOLE_API_TOKEN` | Unset | Bearer token for every `/v1` route. Unset disables authentication. |
| `FLAGPOLE_DATA_FILE` | Unset | JSON file loaded at startup and atomically rewritten after flag mutations. Unset keeps flags in memory. |

`GET /health`, `GET /version`, and `GET /ready` remain public so deployment
probes can read the running `1.1.0` release. See
[Authentication](/api/authentication) before exposing the service.

## Drift store options

Pass options to `createStore<T>()`. Invalid values throw synchronously so the
process fails during startup.

| Option | Default | Purpose |
| --- | --- | --- |
| `maxEntries` | Unlimited | Positive integer cap for the shared LRU budget. |
| `defaultTtlMs` | No expiry | Positive TTL applied when `set()` has no per-entry TTL. |
| `persistPath` | Unset | JSON snapshot loaded on creation and written only when `flush()` is called. |

```typescript
import { createStore } from "driftkv";

const cache = createStore<string>({
  maxEntries: 1_000,
  defaultTtlMs: 60_000,
  persistPath: "./data/cache.json",
});
```

Drift never flushes automatically. Call `flush()` at an application-defined
durability boundary, and expect it to throw when `persistPath` is absent.