Documentation Index
Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
Use this file to discover all available pages before exploring further.
query() and QoderSDKClient require authentication configuration when launching qodercli through the SDK. The recommended approach for scripts, CI, and host applications is a Personal Access Token (PAT) injected via environment variables.
If you have already logged in locally via qodercli, you can also reuse the existing credentials.
Generating a PAT
Generate a Personal Access Token at qoder.com/account/integrations:- Sign in to your Qoder account
- Open Account → Integrations
- Create a new PAT, picking expiry and scopes as needed
- Copy it immediately — the value cannot be retrieved again after the page is closed; if lost, you must regenerate
A single account can hold multiple PATs. Issuing separate tokens per environment (local scripts, CI, production) makes per-token revocation possible.
Reading PAT from the Default Environment Variable
The default environment variable name isQODER_PERSONAL_ACCESS_TOKEN.
Reading PAT from a Custom Environment Variable
options.env and the process environment, the SDK reads the value from options.env first.
Passing the PAT Directly
If your host application has already obtained a PAT from a secrets management service, existing credentials, or a backend API, you can pass it directly. Do not hard-code token literals in source code.Reusing qodercli Login Session
If you have already completed login locally viaqodercli, you can let the SDK delegate to the CLI to read the existing credentials.
Authentication Failure Callback
When the remote rejects the token, the token expires, or the CLI exits with an auth error, useon_auth_expired to trigger a re-login or token refresh flow. It fires at most once per SDK session.
auth configuration.
Errors
- Missing auth configuration:
AuthNotConfiguredError,code == "auth_not_configured". - Environment variable not set:
AuthAccessTokenEnvVarError,code == "auth_access_token_env_var_not_configured".
Best Practices
- In production and CI, prefer environment variables or secrets management services; never hard-code tokens.
- Do not write tokens to logs, error objects, or test snapshots.
- For automated environments, prefer PATs over relying on the local
qoderclilogin session. - For user-facing applications, register
on_auth_expiredto convert authentication failures into clear sign-in prompts.