> For the complete documentation index, see [llms.txt](https://developerdocs.instructure.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developerdocs.instructure.com/services/dap/dap-cli-readme/dap-cli-reference/dap-cli-reference-env-vars.md).

# dap env vars

Configure Environment Variables for DAP CLI Authentication

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` |
* **`DAP_CONSOLE_THEME`** *(optional)*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
