Skip to main content
The Docent SDK authenticates via API keys. You can provide your key in several ways; see the priority table below for the exact resolution order.

API Key

1. Direct Parameter

2. Environment Variable

3. Config File

By default, create a global config file at ~/.docent/docent.env:
The default global config path is ~/.docent/docent.env. The SDK also searches for project-level docent.env files from the current working directory upward, so local files can override the global default when present. You can also specify an explicit path:

Configuration Priority

The SDK resolves each setting using a priority order. The exact order varies slightly by setting:
collection_id is not read from environment variables — set it via a direct parameter or in a discovered docent.env config file (project-level or ~/.docent/docent.env).

Environment Variables

Config File Format

The config file uses dotenv format. Supported keys:

Self-Hosted Instances

For self-hosted Docent instances, set both the API and frontend URLs:
Or via environment variables:
Local domains (localhost, 127.0.0.1) require explicit api_url and frontend_url. The SDK cannot derive URLs from local domains automatically.