Skip to main content

Configuration

The dt-app toolkit will automatically try to resolve a config file named app.config.\{json,js,ts} in the project's root when running a command.

General options

OptionDescriptionTypeRequiredDefault Value
rootProject root directory (where the app.config.\{json,js,ts} file is located). Has to be an absolute path.stringfalseprocess.cwd()
environmentUrlURL to the environment of the project.stringtrue
oauthClientIdProvides the client ID for authenticating via SSO.stringfalsedt0s08.dtp-cli-local
distDirRelative path to the output directory.stringfalsedist/
oauth2FileThe secret file where the oauth2 tokens are stored. Can either be an absolute path or a relative path from root.stringfalse${process.cwd()}/.dt-app/.tokens.json
iconPath 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.stringfalse
deploy.buildWhether the app should automatically be built before deployment or not.booleanfalsetrue
injectSdkWhether the SDK should be injected or not.booleanfalsetrue
dev.fileWatcher.ignoreGlob pattern to specify which files should be ignored by the file-watcher that triggers a rebuild.string[]false[**​/*.spec.{ts,tsx}, **​/*.test.ts]
dev.fileWatcher.includeGlob pattern to specify which files should be watched (apart from the root) by the file-watcher that triggers a rebuild.string[]false[]

App options

Options that are used to generate the manifest.

OptionDescriptionTypeRequired
app.idThe unique identifier of the app. Limited to 50 characters.stringtrue
app.nameThe name of the app. Limited to 40 characters.stringtrue
app.versionThe version of the app.stringtrue
app.descriptionThe description of the app. Limited to 80 characters.stringtrue
app.hiddenHides the listing in the App Launcher. Useful for widget apps.booleanfalse
app.intentsThe list of app capabilities of handling the intents.IntentsDeclarationsfalse
app.pageTokensThe list of page tokens exposed by the app.Record<string,string>false
app.csp.font-srcThe font-src directive specifies valid sources for fonts loaded.DirectiveValue[]false
app.csp.img-srcThe img-src directive specifies valid sources of images and favicons.DirectiveValue[]false
app.csp.media-srcThe media-src directive specifies valid sources for loading media.DirectiveValue[]false
app.csp.style-srcThe style-src directive specifies valid sources for stylesheets.DirectiveValue[]false
app.csp.script-srcThe 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.scopesThe list of scopes required by the app.OAuthScope[]true
app.selfMonitoringAgentThe self monitoring agent urlstringfalse

Setting app options inside the app.config.json

{
"app": {
"id": "my.app",
"name": "My App",
"description": "My description",
"version": "1.0.0"
}
}

Build options

Options for customizing the build process.

OptionDescriptionTypeRequiredDefault Value
build.modeWhether the build should be performed in production or development mode.'production' | 'development'falseproduction
build.settingsPathA path to custom settings json files.stringfalsesettings/schemas
build.ui.entryPointRelative path to the file that serves as the main entry point for the UI.stringfalsesrc/main.tsx
build.ui.tsconfigRelative path (from root) to tsconfig file.stringfalsetsconfig.json
build.ui.assetsAssets that should be bundled and served.Asset[]false
build.ui.sourceMapsOutput 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'falseundefined
build.ui.pluginsPlugins that should be used to inject code into various parts of the build process.EsbuildPlugin[]false[]
build.functions.inputRelative path to function files.stringfalseapi/
build.functions.globPattern to specify which files should be built and deployed as functions. Always use UNIX style separators.stringfalse**​/*.ts
build.functions.tsconfigRelative path (from input) to tsconfig file.stringfalsetsconfig.json
build.functions.sourceMapsOutput 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'falseundefined
build.functions.pluginsPlugins that should be used to inject code into various parts of the build process.EsbuildPlugin[]false[]

Server options

Options for the development server.

OptionDescriptionTypeRequiredDefault Value
server.openWhether the project should be opened in the browser after startup or not.booleanfalsetrue
server.portPort where the app should be served.numberfalse3000
server.hostThe host IP to bind the dev server on.stringfalse127.0.0.1
server.showWarningsWhether build warnings should be displayed in the dev server or not.booleanfalsefalse
server.enableCSPWhether the dev server should add CSP headers to all requests. If true, the dev server will generate a set of default CSP Directives and add the custom CSP Directives to this set if specified. In local development, frame-src and frame-ancestors are always set to *booleanfalsetrue
server.https.certPath to cert in PEM formatstringtrue
server.https.keyPath to private key in PEM formatstringtrue

Example

{
server: {
open: false,
port: 3001,
host: '127.0.0.1',
showWarnings: true
}
}

Assets

In the UI build configuration, it is possible to specify an array of assets. These assets are served statically by the development server and the app registry once the app is deployed.

OptionDescriptionTypeRequired
globPattern to specify which files inside the input folder are assets. Always use UNIX style separators.stringtrue
ignoreGlob Patterns to exclude. Always use UNIX style separators.string[]false
inputRelative (from root) or absolute path where the glob is executed.stringtrue
outputRelative path (from distDir) to directory where assets are copied to.stringtrue

Default

assets: [
{
glob: '**/*',
ignore: [],
input: 'src/assets',
output: 'assets',
},
];

CLI Flags

Flags to manipulate dt-app commands.

OptionDescriptionTypeRequired
dryRunDon't actually perform the command. Used for deploy and uninstall. Can only be set with CLI flag --dry-runbooleanfalse
forceOverwriteOverwrite an existing app with the same id if it has been deployed by another user. Please make sure the required permissions are set. Used for the deploy command. Can only be set with CLI flag --force-overwrite. Note: this flag can't be used to overwrite specific versions of apps.booleanfalse
noLiveReloadDisable live reload (file watcher) of development server. Used for dev command. Can only be set with CLI flag --no-live-reload.booleanfalse

Telemetry

Help to improve Dynatrace’s features and performance. The Dynatrace App Toolkit automatically sends usage statistics and crash reports to Dynatrace anonymously.

To deactivate telemetry reporting for the current session:

export DT_APP_DISABLE_TELEMETRY=1

To deactivate telemetry reporting for your profile in all sessions

  1. Run:
    echo "export DT_APP_DISABLE_TELEMETRY=1" >>~/.profile
  2. Run:
    source ~/.profile

To deactivate telemetry reporting for your profile in all sessions for Windows

  1. Run:
    setx DT_APP_DISABLE_TELEMETRY 1
  2. Run:
    refreshenv (it might be necessary to restart your terminal)

Build target

Apps built with the Dynatrace App Toolkit currently target ECMAScript 2017. The target standard is not configurable and based on the state of the JavaScript ecosystem, required features and browser support.

Target
App UIes2021
Actions UIes2021
Functionsesnext

Supported file types

App functions can't access the file system. Files types that are allowed and can be imported are: .js, .ts, .json, .txt

Environment Variables

NameDescriptionValuesDefault Value
DT_APP_DISABLE_TELEMETRYDisables the sending of anonymous usage statistics and crash reports to dynatrace by setting it to 1.not set or 1not set
DT_APP_OAUTH_CLIENT_IDAlternative to setting oauthClientId in app.config.\{json,js,ts}. Should only be set as an environment variable in combination with DT_APP_OAUTH_CLIENT_SECRET to automate retrieving a SSO-Token. This can be useful for using the CLI in a CI-Pipeline.
DT_APP_OAUTH_CLIENT_SECRETClientSecret used for authenticating with the Dynatrace Platform.
DT_APP_ENVIRONMENT_URLAlternative to setting environmentUrl in app.config.\{json,js,ts}.
DT_APP_SIGNING_PKPrivate key to sign the app.
DT_APP_SIGNING_CERTCertificate to sign the app.
DEBUGPrint debug logs to the console for more information.set or not set
DT_APP_SERVERLESS_MAX_CONNECTIONSThe maximum number of app function connections.128

Logs

Logs can be found in .dt-app/logs inside your app directory.

Still have questions?
Find answers in the Dynatrace Community