Skip to main content
The Docent SDK supports API keys and two AWS workload-identity protocols. Use an organization service-account API key for most automation. In AWS-hosted environments, outbound OIDC avoids storing a Docent secret in the workload. Pass only one of api_key, aws_oidc_identity=True, or aws_federated_identity=True to a client. From your project directory, run the setup CLI and paste a key from Settings → API Keys when prompted:
The prompt does not echo the key. Setup validates it before updating the global config at ~/.docent/docent.env. Use one of the manual options below for CI, secret managers, profile-formatted config, or project-specific overrides.

API Key

1. Direct Parameter

2. Environment Variable

AWS outbound OIDC

AWS outbound OIDC is the preferred AWS authentication method. It mints a five-minute JWT for the Docent deployment origin and verifies the account’s issuer, the audience, the exact IAM role, and the token signature. Install the AWS extra:
An organization administrator must first connect the IAM role and its account-specific outbound OIDC issuer to a Docent service account. The workload role also needs sts:GetWebIdentityToken, restricted to the Docent API origin with sts:IdentityTokenAudience.
The SDK uses the normal AWS credential chain. For a named local profile or an explicit regional STS endpoint:
GetWebIdentityToken is unavailable on the global STS endpoint, so workloads must be able to reach a regional endpoint. The Docent API must be able to reach the issuer’s OIDC discovery and JWKS endpoints.

Legacy AWS signed-request authentication

Existing service-account bindings without an OIDC issuer can continue using the earlier audience-bound signed STS proof:
Use outbound OIDC for new bindings. Both AWS protocols stop authorizing new requests immediately when the service account is disabled or its IAM role is disconnected.

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:
AWS authentication uses the same api_url, frontend_url, and domain resolution. The SDK derives the AWS token audience from the API URL’s origin. 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.