# dap env vars

To simplify configuration and improve security, the DAP CLI supports reading authentication and connection settings from environment variables. This is optional but highly recommended for automation and scripting on macOS, Linux, and Windows.

## Available Environment Variables

```sh
export DAP_API_URL='https://api-gateway.instructure.com'
export DAP_CLIENT_ID='your_canvas_data_client_id'
export DAP_CLIENT_SECRET='your_canvas_data_secret'
export DAP_CONNECTION_STRING='your_database_connection_string'
export DAP_TRACKING='your_tracking_preference'
```

### Variable Descriptions

* **`DAP_API_URL`** *(optional)*\
  Specifies the API endpoint. If omitted, the CLI uses the default production URL. Useful when working in beta or staging environments.
* **`DAP_CLIENT_ID`**\
  Your client ID from [Instructure Identity](https://identity.instructure.com).
* **`DAP_CLIENT_SECRET`**\
  Your client secret from [Instructure Identity](https://identity.instructure.com).
* **`DAP_CONNECTION_STRING`** *(optional)*\
  The connection string to your target database. Supported formats:

  ```
  postgresql://user:password@host:5432/database
  mysql://user:password@host:3306/database
  mssql://user:password@host:1433/database
  ```
* **`DAP_TRACKING`**\
  Controls whether CLI usage tracking is enabled. Tracking is enabled by default. To opt out, use one of the values listed below.

  Valid values for enabling/disabling tracking:

  | Enabled Values           | Disabled Values           |
  | ------------------------ | ------------------------- |
  | `true`, `1`, `yes`, `on` | `false`, `0`, `no`, `off` |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developerdocs.instructure.com/services/dap/dap-cli-readme/dap-cli-reference/dap-cli-reference-env-vars.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
