Subchapter 23.1
references/build-upload-publish.mdMarkdown3 KBView on GitHub
Use this when the user needs to build, upload, publish, configure the Datadog site, or interpret upload output.
Inspect the generated package.json scripts before choosing a command; scaffolder behavior can change. Use typecheck for a credential-free TypeScript check when available:
npm run typecheckRun the generated upload script directly:
npm run uploadnpm run upload builds with asset upload enabled and publishes the new version live. A successful upload prints a Datadog URL for the uploaded app. Upload uses OAuth by default. If both DD_API_KEY and DD_APP_KEY are set, the generated app uses those keys instead of OAuth.
In some scaffold versions, npm run build may also exercise Datadog upload behavior. If it needs auth, complete the OAuth browser flow or set both key environment variables. Use typecheck for local compile validation that does not touch Datadog.
To upload a draft without immediately publishing it live, use the upload-no-publish script. This is useful for staging environments or CI pipelines where a separate approval step controls promotion.
Projects scaffolded with npm create @datadog/apps already include this script. Run it directly:
npm run upload-no-publishIf the project’s package.json does not already have the script (older scaffolded projects), add it:
{
"scripts": {
"upload": "DD_APPS_UPLOAD_ASSETS=1 vite build",
"upload-no-publish": "DD_APPS_UPLOAD_ASSETS=1 DD_APPS_PUBLISH=false vite build"
}
}You can also pass the flag inline without a dedicated script:
DD_APPS_PUBLISH=false npm run uploadAfter an upload-no-publish, the new version appears in the App Builder version history but does not go live. Publish it from the App Builder UI when ready.
Relevant environment variables:
DD_API_KEY: optional Datadog API key for key-based local dev or upload.DD_APP_KEY: optional Datadog application key for key-based local dev or upload.DD_APPS_PUBLISH: set to false to upload without publishing. Defaults to true.DD_APPS_VERSION_NAME: optional unique uploaded app version name.DD_APPS_UPLOAD_ASSETS: enables asset upload; upload scripts normally set this.For non-US1 sites, set the Datadog site in vite.config.ts so local development and uploads target the right site:
datadogVitePlugin({
auth: {
site: '<YOUR_DATADOG_SITE>',
},
});After upload, the app appears in the App Builder app list. From there users can publish the app, edit name and description, manage permissions, and embed it in supported Datadog surfaces.
Locally built Apps cannot be edited with low-code App Builder drag-and-drop UI. Update the local code and re-upload instead.