diff --git a/docs/get-started/installation/index.mdx b/docs/get-started/installation/index.mdx index 57abb53f..639e0d8a 100644 --- a/docs/get-started/installation/index.mdx +++ b/docs/get-started/installation/index.mdx @@ -48,6 +48,27 @@ You should see output in the terminal indicating the progress and results of the [![Sample test screenshot](./example.png)](./example.png) +## Environment Variables + +You can customize Doc Detective's behavior with environment variables. + +### DOC_DETECTIVE_API_URL + +Override the default Doc Detective API endpoint. Use this for enterprise or custom API deployments. + +Default: `https://api.doc-detective.com/v1` + +Set the environment variable before running tests: + +```bash +export DOC_DETECTIVE_API_URL=https://custom-api.example.com/v1 +npx doc-detective --input sample.spec.json +``` + +This variable only works when you've set an API key with `integrations.docDetectiveApi.apiKey` in your config. When you set an API key, Doc Detective runs tests via the API instead of locally. + +For more information, see the [configuration reference](/docs/references/schemas/config) and [integrations options](/docs/references/schemas/integrations-options). + ## Next steps Next up, take a look at some of the [concepts](/docs/get-started/concepts) native to Doc Detective, check out some of the guided [tutorials](/docs/category/tutorials), or explore how to write [tests](/docs/get-started/tests) and [actions](/docs/category/actions) to automate your documentation testing. \ No newline at end of file diff --git a/docs/references/schemas/config.md b/docs/references/schemas/config.md index 828a3a1f..ad2c0cc1 100644 --- a/docs/references/schemas/config.md +++ b/docs/references/schemas/config.md @@ -25,6 +25,7 @@ logLevel | string | Optional. Amount of detail to output when performing an oper runOn | array of object([context](/docs/references/schemas/context)) | Optional. Contexts to run the test in. Overrides contexts defined at the config and spec levels. | fileTypes | array of one of: string, object([File type (custom)](/docs/references/schemas/file-type-custom)), object([File type (executable)](/docs/references/schemas/file-type-executable)) | Optional. Configuration for file types and their markup detection. | ``["markdown","asciidoc","html","dita"]`` integrations | object([Integrations options](/docs/references/schemas/integrations-options)) | Optional. Options for connecting to external services. | +apiMaxWaitTime | integer | Optional. Maximum time in seconds to wait for API-based test execution to complete. Only applicable when `integrations.docDetectiveApi.apiKey` is configured. | `600` telemetry | object([Telemetry options](/docs/references/schemas/telemetry-options)) | Optional. Options around sending telemetry for Doc Detective usage. | ``{"send":true}`` concurrentRunners | integer,boolean | Optional. Number of concurrent test runners. Set to true to use CPU core count (capped at 4).

Minimum: 1 | `1` environment | object([Environment details](/docs/references/schemas/environment-details)) | ReadOnly. Environment information for the system running Doc Detective. | @@ -157,3 +158,14 @@ debug | one of:
- boolean
- string | Optional. Enable debugging mode. `t "debug": "stepThrough" } ``` + +```json +{ + "integrations": { + "docDetectiveApi": { + "apiKey": "your-api-key" + } + }, + "apiMaxWaitTime": 300 +} +``` diff --git a/docs/references/schemas/integrations-options.md b/docs/references/schemas/integrations-options.md index 04f34f18..2960d751 100644 --- a/docs/references/schemas/integrations-options.md +++ b/docs/references/schemas/integrations-options.md @@ -12,6 +12,8 @@ Options for connecting to external services. Field | Type | Description | Default :-- | :-- | :-- | :-- openApi | array of unknown | Optional. No description provided. | +docDetectiveApi | object | Optional. Configure Doc Detective to run tests via the Doc Detective API instead of locally. When an API key is provided, tests are executed on remote infrastructure. | +docDetectiveApi.apiKey | string | Required (if docDetectiveApi is used). API key for authenticating with the Doc Detective API. | ## Examples @@ -20,3 +22,11 @@ openApi | array of unknown | Optional. No description provided. | "openApi": [] } ``` + +```json +{ + "docDetectiveApi": { + "apiKey": "your-api-key-here" + } +} +```