- Getting-started
- 2 minutes
Dynatrace App Toolkit
A powerful CLI toolkit for creating, developing, and deploying Dynatrace Apps. Streamline your development workflow.
Create a new Dynatrace app from a template
npx dt-app create
Start development server to see changes with hot replacement.
npx dt-app dev
Deploy your app to your Dynatrace environment
npx dt-app deploy
Getting started
Updating from Dynatrace App Tookit v0.x to v1.x needs a few manual steps for your older workspaces. Please check out: Migrating from v0.x to v1.x
Dynatrace App Toolkit requirements
To use the Dynatrace App Toolkit, ensure your environment meets the following prerequisites:
- NodeJS version 20 must be installed on your local machine.
- Access to the following URLs:
- https://dt-cdn.net/
- https://registry.npmjs.org/
- Access to your desired Dynatrace environment.
- Local port range 3000-3005 must be available for local app development. Alternatively, configure a custom port.
- Local port 30000 must be available for local app function execution.
- Local port 5343 must be available for the SSO authentication process. If the port is unavailable, the toolkit will try the next port.
- Access to localhost.
- Access to a command line interface (for example, PowerShell, cmd, Linux terminal, macOS terminal) and the ability to execute scripts.
- Read/write access to the directory where your app is located.
- Access to read app templates on github.com.
Command reference
Complete reference for all available commands and their options.
Create and initialize
Everything related to starting a new project or adding new components:
dt-app create
Create new Dynatrace App.
Argument | Description |
---|---|
[name] | The name of the app. |
Option | Description |
---|---|
--cwd [dir] | Set the current working directory. |
--dry-run | Do not write any changes to the file system. |
--environment-url <name> | Specify your environment. |
--no-color | Terminal output renders without color. |
--no-git | Do not initialize a git repository. |
--non-interactive | Run in non-interactive mode. Throws error when a required command option or argument is missing. |
--skip-install | Do not install dependencies after initialization. |
--template [name] | Choose the template to generate the app from. |
--template-dir <dir> | Specify the directory that contains the template your app should be created from. |
--verbose [context] | Output additional debug logs. Add optional context to filter. % at the end as wildcard possible. Example: "--verbose cli-%" |
dt-app action create
Create a custom workflow action.
Argument | Description |
---|---|
[name] | The name of the action. |
Option | Description |
---|---|
--cwd [dir] | Set the current working directory. |
--dry-run | Do not write any changes to the file system. |
--no-color | Terminal output renders without color. |
--non-interactive | Run in non-interactive mode. Throws error when a required command option or argument is missing. |
--skip-tests | Do not generate test files. |
--verbose [context] | Output additional debug logs. Add optional context to filter. % at the end as wildcard possible. Example: "--verbose cli-%" |
dt-app function create
Create an app function.
Argument | Description |
---|---|
[name] | The name of the function. |
Option | Description |
---|---|
--cwd [dir] | Set the current working directory. |
--dry-run | Do not write any changes to the file system. |
--generate-tests | Generate test files for functions without tests. |
--no-color | Terminal output renders without color. |
--non-interactive | Run in non-interactive mode. Throws error when a required command option or argument is missing. |
--skip-tests | Do not generate test files. |
--verbose [context] | Output additional debug logs. Add optional context to filter. % at the end as wildcard possible. Example: "--verbose cli-%" |
Develop and operate
Commands used during development, testing, and maintaining:
dt-app dev
Start the development server.
Option | Description |
---|---|
--cwd [dir] | Set the current working directory. |
--environment-url [url] | Set the target environment for app deployment. |
--host [name] | The host IP to bind the dev server on. |
--no-color | Terminal output renders without color. |
--no-live-reload | Disable file watching and browser live reloading |
--no-open | Do not open the browser with the dev server. |
--no-type-check | Skip type checking. |
--non-interactive | Run in non-interactive mode. Throws error when a required command option or argument is missing. |
--verbose [context] | Output additional debug logs. Add optional context to filter. % at the end as wildcard possible. Example: "--verbose cli-%" |
-o, --open | Open the browser with the dev server. |
-p, --port <number> | The port where the files should be served. |
-w, --show-warnings | Display build warnings. |
dt-app build
Build the app and analyze the bundle.
Option | Description |
---|---|
--cwd [dir] | Set the current working directory. |
--no-color | Terminal output renders without color. |
--no-type-check | Skip type checking. |
--non-interactive | Run in non-interactive mode. Throws error when a required command option or argument is missing. |
--verbose [context] | Output additional debug logs. Add optional context to filter. % at the end as wildcard possible. Example: "--verbose cli-%" |
dt-app update
Update @dynatrace-scoped packages and the App Toolkit to the latest version and apply automatic migrations.
Argument | Description |
---|---|
[packages...] | The packages that should be updated. |
Option | Description |
---|---|
--cwd [dir] | Set the current working directory. |
--no-color | Terminal output renders without color. |
--non-interactive | Run in non-interactive mode. Throws error when a required command option or argument is missing. |
--skip-install | Do not install dependencies after migrations. |
--verbose [context] | Output additional debug logs. Add optional context to filter. % at the end as wildcard possible. Example: "--verbose cli-%" |
--yes | [DEPRECATED use --non-interactive instead] Update all outdated packages without prompt for confirmation. |
-i, --interactive | Choose the packages you want to update manually. |
dt-app migration execute
Execute a migration.
Option | Description |
---|---|
--cwd [dir] | Set the current working directory. |
--from <currentVersion> | The current version of the package. |
--no-color | Terminal output renders without color. |
--non-interactive | Run in non-interactive mode. Throws error when a required command option or argument is missing. |
--package <name> | The name of the package. |
--to <newVersion> | The new version of the package. |
dt-app analyze
Analyze app to check for valid app configurations, security issues and bundle statistics.
Option | Description |
---|---|
--cwd [dir] | Set the current working directory. |
--no-color | Terminal output renders without color. |
--non-interactive | Run in non-interactive mode. Throws error when a required command option or argument is missing. |
--verbose [context] | Output additional debug logs. Add optional context to filter. % at the end as wildcard possible. Example: "--verbose cli-%" |
dt-app info
Output detailed information about the App Toolkit and the environment.
Option | Description |
---|---|
--cwd [dir] | Set the current working directory. |
--no-color | Terminal output renders without color. |
--non-interactive | Run in non-interactive mode. Throws error when a required command option or argument is missing. |
--verbose [context] | Output additional debug logs. Add optional context to filter. % at the end as wildcard possible. Example: "--verbose cli-%" |
dt-app version
Print the version of the App Toolkit.
Option | Description |
---|---|
--no-color | Terminal output renders without color. |
--non-interactive | Run in non-interactive mode. Throws error when a required command option or argument is missing. |
dt-app help
Display a set of dt-app commands with a description.
No options available.
Deploy
Commands used for deploying your app:
dt-app deploy
Build and deploy your app to a configured Dynatrace environment.
Option | Description |
---|---|
--cwd [dir] | Set the current working directory. |
--dry-run | Perform a dry run without app deployment. |
--environment-url [url] | Set the target environment for app deployment. |
--no-color | Terminal output renders without color. |
--no-open | Do not open the browser with the dev server. |
--no-type-check | Skip type checking. |
--non-interactive | Run in non-interactive mode. Throws error when a required command option or argument is missing. |
--sign-archive | Sign the archive that will be deployed. If you need to specify a different signing endpoint, set the appropriate environment variables. For more details, refer to the Environment Variables section. |
--skip-build | Skip the build before deploying. |
--verbose [context] | Output additional debug logs. Add optional context to filter. % at the end as wildcard possible. Example: "--verbose cli-%". |
dt-app uninstall
Uninstall the app from the specified environment.
Option | Description |
---|---|
--cwd [dir] | Set the current working directory. |
--dry-run | Do not actually remove the app only perform a dry run. |
--environment-url [url] | Set the target environment for app deployment. |
--no-color | Terminal output renders without color. |
--no-open | Do not open the browser with the dev server. |
--non-interactive | Run in non-interactive mode. Throws error when a required command option or argument is missing. |
--verbose [context] | Output additional debug logs. Add optional context to filter. % at the end as wildcard possible. Example: "--verbose cli-%" |
Configuration
Comprehensive guide to configuring your Dynatrace App Toolkit.
App Toolkit configurations
These configurations are set in the app.config.json
in your Dynatrace App's workspace.
General options
Project related options.
Option | Description | Type | Required | Default Value |
---|---|---|---|---|
environmentUrl | URL to the environment of the project. | string | true |
App options
Configures your app's appreance and more.
Example:
{
"app": {
"id": "my.app",
"name": "My App",
"description": "My description",
"version": "1.0.0"
}
}
Option | Description | Type | Required |
---|---|---|---|
app.id | The unique identifier of the app. Limited to 50 characters. Must be an alphanumeric string containing only lowercase characters. | string | true |
app.name | The name of the app. Limited to 40 characters. | string | true |
app.version | The version of the app. | string | true |
app.description | The description of the app. Limited to 80 characters. | string | true |
app.icon | Path to the app icon, can either be a .svg (recommended) or .png file. An icon will be auto-generated if no icon path is set. | string | false |
app.hidden | Hides the listing in the App Launcher. Useful for widget apps. | boolean | false |
app.intents | The list of app capabilities of handling the intents. | IntentsDeclarations | false |
app.pageTokens | The list of page tokens exposed by the app. | Record<string,string> | false |
app.csp.font-src | The font-src directive specifies valid sources for fonts loaded. | DirectiveValue[] | false |
app.csp.img-src | The img-src directive specifies valid sources of images and favicons. | DirectiveValue[] | false |
app.csp.media-src | The media-src directive specifies valid sources for loading media. | DirectiveValue[] | false |
app.csp.style-src | The style-src directive specifies valid sources for stylesheets. | DirectiveValue[] | false |
app.csp.script-src | The script-src directive specifies valid sources for JavaScript. This includes not only URLs loaded directly into script elements, but also things like inline script event handlers (onclick) and XSLT stylesheets which can trigger script execution. | DirectiveValue[] | false |
app.scopes | The list of scopes required by the app. | OAuthScope[] | true |
app.selfMonitoringAgent | The self monitoring agent url | string | false |
Build options
Options for customizing the build process.
Option | Description | Type | Required | Default Value |
---|---|---|---|---|
build.mode | Whether the build should be performed in production or development mode. | 'production' | 'development' | false | 'production' when building and 'development' when using development server |
build.sourceMaps | Output source maps for app code and libraries. If set to 'true', only source maps for app code is included. Source maps for node_modules are included if the option is set to 'all'. By default, the option is treated as 'all' for development and 'false' for builds. | boolean | 'all' | false | undefined |
build.sourceRoot | Location of source files. | string | false | ./ |
Apps built with the Dynatrace App Toolkit currently target es2021. The target standard is not configurable and based on the state of the JavaScript ecosystem, required features and browser support.
Target | |
---|---|
App UI | es2021 |
Functions | esnext |