ESA runtime environment variables are not available to this edge function, so private access tokens are injected at build time by tools/inline-static.mjs.
Use:
SPEEDTEST_TOKEN='<base64url-random-43-chars-or-longer>' npm run build:edgeor:
SPEEDTEST_TOKENS='<token-a>,<token-b>' npm run build:edgeDo not use VITE_ for private tokens. Vite exposes VITE_ variables to frontend code.
Never commit:
.envor local environment files.dist/.dist-edge/.- Any generated
edge.jsthat contains embedded deployment tokens. - Real app tokens, ESA credentials, access keys, cookies, or private endpoints.
Before pushing to a public repository, run:
npm run scan:privacyRecommended rotation sequence:
- Build with both old and new tokens using
SPEEDTEST_TOKENS. - Release the app update that sends the new token.
- Rebuild ESA with only the new token.
- Delete any old local build artifacts that may contain the old token.