You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/actions/datadog_apps.md
+23-15Lines changed: 23 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ Choose Apps when you need:
40
40
```shell
41
41
node --version
42
42
```
43
-
- A Datadog **API key** and an **application key** with [Actions API Access][5] enabled. For instructions on creating keys, see [API and Application Keys][6].
43
+
-Optional: A Datadog **API key** and an **application key** with [Actions API Access][5] enabled. Required for API-key-backed build telemetry (build metrics and Error Tracking sourcemap uploads) and for CI/CD uploads. For instructions, see [API and Application Keys][6].
44
44
45
45
To enable Actions API Access on an application key:
46
46
@@ -69,20 +69,15 @@ The scaffolded project includes:
69
69
70
70
## Develop your app locally
71
71
72
-
1. Set your Datadog credentials as environment variables:
73
-
74
-
```shell
75
-
export DD_API_KEY="<YOUR_API_KEY>"
76
-
export DD_APP_KEY="<YOUR_APPLICATION_KEY>"
77
-
```
78
-
79
-
2. Start the development server:
80
-
72
+
1. Start the development server:
81
73
```shell
82
74
npm run dev
83
75
```
76
+
2. Open the URL shown in the terminal (for example, `http://localhost:5173/`) to preview your app.
77
+
78
+
When the dev server needs to call Datadog, such as when running a backend function locally, it uses OAuth by default. If authorization is required, the command opens a browser prompt. After authorization completes, the token is cached in your operating system credential store.
84
79
85
-
3. Open the URL shown in the terminal (for example, `http://localhost:5173/`) to preview your app.
80
+
If you set both `DD_API_KEY` and `DD_APP_KEY`, the generated app uses those keys instead of OAuth.
86
81
87
82
### Backend functions
88
83
@@ -150,12 +145,15 @@ Use `npm run upload` to build and upload the app to Datadog. This runs `vite bui
150
145
npm run upload
151
146
```
152
147
148
+
Uploads use OAuth by default and may open a browser authorization flow the first time. If you set both `DD_API_KEY` and `DD_APP_KEY`, uploads use API and application key authentication instead.
149
+
153
150
The following environment variables are available:
154
151
155
152
| Variable | Description |
156
153
|---|---|
157
-
|`DD_API_KEY`| Datadog API key. |
158
-
|`DD_APP_KEY`| Datadog application key. |
154
+
|`DD_API_KEY`| Optional. Datadog API key used with `DD_APP_KEY` for local development and uploads. Also enables API-key-backed build telemetry, such as build metrics and Error Tracking sourcemap uploads. |
155
+
|`DD_APP_KEY`| Optional. Application key used with `DD_API_KEY` for local development and uploads. |
156
+
|`DD_APPS_AUTH_METHOD`| Optional. Set to `oauth` or `apiKey` to override the generated app's authentication method. |
159
157
|`DD_APPS_VERSION_NAME`| Optional. The version name for the uploaded app version. Must be a unique string per app. If unset, Datadog assigns a version name. |
160
158
|`DD_APPS_UPLOAD_ASSETS`| If set, uploads built assets to Datadog. Set automatically by `npm run upload`. |
161
159
@@ -185,6 +183,8 @@ To change an app's UI or logic, update the code in your local project and re-upl
185
183
186
184
To automatically upload your app on every push to the `main` branch, use the [`DataDog/apps-github-action`][11] GitHub Action. This action builds your app and uploads it to Datadog.
187
185
186
+
CI/CD uploads require API and application key authentication. Create a Datadog API key and an application key with [Actions API Access][5] enabled, then store them as GitHub secrets.
187
+
188
188
If your organization is not on US1 (`datadoghq.com`), set `auth.site` in `vite.config.ts` to your [Datadog site][15]. The build reads this configuration when uploading the app, so the same setting also applies to local development. Your Datadog site is `{{< region-param key="dd_site" >}}`.
189
189
190
190
{{< site-region region="us3,us5,eu,ap1,ap2" >}}
@@ -237,15 +237,23 @@ jobs:
237
237
238
238
### Authentication errors
239
239
240
-
Authentication errors (such as 401 or `Missing authentication token`) and backend function call failures usually point to missing or invalid credentials. Verify that `DD_API_KEY` and `DD_APP_KEY` are set, and that the application key has [Actions API Access][5] enabled.
240
+
For local development and uploads, OAuth authentication errors may have one of these causes:
241
+
242
+
- The OAuth browser flow did not complete.
243
+
- The cached OAuth token is invalid.
244
+
- `auth.site` does not match your Datadog site.
245
+
246
+
Rerun the command and complete the browser authorization flow.
247
+
248
+
If you use API and application key authentication, authentication errors usually point to missing or invalid credentials. Backend function call failures can have the same cause. Verify that `DD_API_KEY` and `DD_APP_KEY` are set, and that the application key has [Actions API Access][5] enabled.
241
249
242
250
### Build succeeds but nothing uploads
243
251
244
252
Make sure you ran `npm run upload` (not `npm run build`), and that `dryRun` in `vite.config.ts` is not set to `true`.
245
253
246
254
### Node.js version errors during scaffolding
247
255
248
-
The scaffolding tool requires Node.js 20.12.0 or later. If you see errors even on a supported version, upgrade to v22. Use a version manager such as [nvm][16], [Volta][17], or [fnm][18], or download from [nodejs.org][19].
256
+
The scaffolding tool requires Node.js 20.12.0 or later. If you see errors even on a supported version, upgrade to v22. Use a version manager such as [nvm][16], [Volta][17], or [fnm][18], or download from the [Node.js website][19].
0 commit comments