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
feat(wasm): add WASM build support with DD_ACCESS_TOKEN auth
Enable pup to compile to WebAssembly (GOOS=js GOARCH=wasm) for use in
browser-like runtimes (Deno, Bun, Cloudflare Workers). The WASM build
uses stateless authentication via DD_ACCESS_TOKEN since keychain storage
and browser-based OAuth login are not available in WASM environments.
- Add DD_ACCESS_TOKEN as highest-priority auth method (all platforms)
- Extract OAuth storage logic into build-tagged files (oauth_storage.go)
- Add //go:build !js to keychain, factory, and auth command files
- Create WASM stubs for storage, keychain, factory, and auth commands
- Add pup-wasm build target to GoReleaser with wasm_exec.js
- Add WASM build verification step to CI workflow
- Add DD_ACCESS_TOKEN tests for priority, fallthrough, and forceAPIKeys
- Update README with WASM section and DD_ACCESS_TOKEN documentation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
-`DD_TOKEN_STORAGE`: Token storage backend (keychain or file, default: auto-detect)
341
356
357
+
## WASM
358
+
359
+
Pup compiles to WebAssembly (`GOOS=js GOARCH=wasm`) for use in browser-like runtimes such as Deno, Bun, and Cloudflare Workers.
360
+
361
+
### Building
362
+
363
+
```bash
364
+
GOOS=js GOARCH=wasm go build -o pup.wasm .
365
+
366
+
# Copy the Go WASM support file
367
+
cp "$(go env GOROOT)/lib/wasm/wasm_exec.js".
368
+
```
369
+
370
+
### Authentication
371
+
372
+
The WASM build uses **stateless authentication only** — keychain storage and browser-based OAuth login are not available. Set `DD_ACCESS_TOKEN` with a pre-obtained bearer token:
373
+
374
+
```bash
375
+
DD_ACCESS_TOKEN="your-token" DD_SITE="datadoghq.com" deno run pup.wasm monitors list
376
+
```
377
+
378
+
The `pup auth status` command works in WASM and reports which credentials are configured. The `login`, `logout`, and `refresh` subcommands return guidance to use `DD_ACCESS_TOKEN`.
379
+
380
+
### Limitations
381
+
382
+
- No local token storage (keychain/file) — use `DD_ACCESS_TOKEN`
383
+
- No browser-based OAuth login flow
384
+
- Networking relies on the host runtime's Fetch API
0 commit comments