npx skills add ...
npx skills add dynatrace/dynatrace-for-ai --skill dt-js-runtime
Dynatrace server-side JS runtime — function contract, runtime limits, Web APIs, Node.js modules, fetch with credential vault, and the @dynatrace-sdk/* catalog.
npx skills add dynatrace/dynatrace-for-ai --skill dt-js-runtime
The Dynatrace JS runtime is a server-side AppEngine sandbox that executes JavaScript/TypeScript.
Every entry point must export a default async function:
ES module syntax required. TypeScript accepted (type annotations, interfaces, generics). No other export shape is supported.
Start here, then load only the file you need.
| File | When to load |
|---|---|
| references/limits-and-restrictions.md | Timeout / memory / I/O quotas; what's forbidden (eval, WebSocket, sockets, filesystem) |
| references/apis-and-modules.md | Which Web APIs and Node.js compat modules are available (fetch, crypto, streams, buffer, …) |
| references/fetch.md | Calling internal /platform/... APIs or external URLs, credential vault, outbound allowlist |
| references/sdk.md | Any @dynatrace-sdk/* package — the index routes you to the right per-SDK file |
Use dtctl exec function to run JS runtime code without deploying an app.
The function may accept an optional parameter. --payload is parsed and passed
as that argument directly — it is not wrapped in an event.payload field:
Load the dynatrace-control skill for authentication setup, context switching, and the full exec function reference.
export default async function(payload) {
// with --payload '{"key":"value"}', payload is {"key": "value"}
return payload.key;
}