diff --git a/packages/plugins/apps/README.md b/packages/plugins/apps/README.md index f7e98d130..9e1712a93 100644 --- a/packages/plugins/apps/README.md +++ b/packages/plugins/apps/README.md @@ -18,6 +18,7 @@ It needs Vite 6.4 or later: on an older Vite, it stops every Vite command with a - [Cloud execution](#cloud-execution) - [Local execution](#local-execution) - [Backend function runtime](#backend-function-runtime) +- [Development server Content Security Policy](#development-server-content-security-policy) - [Package output](#package-output) - [apps.enable](#appsenable) - [apps.include](#appsinclude) @@ -117,6 +118,29 @@ Backend functions run on the Node backend runtime, and the plugin's build-time a The checks also warn, without failing the build, about `process.env` reads: in production, the Node backend runtime doesn't pass your own environment variables or Custom Credentials to backend functions, so those reads don't see your values there. They catch direct reads: `process.env.X`, `process.env[key]`, a destructure of `process.env`, an `env`, default or namespace import from `process` or `node:process`, and a `const` bound to `process.env` or to an `env` destructured from `process`. Like the other checks, they cover only the app's own code and opted-in packages, so an SDK that reads `process.env` (for example, for a default API key) doesn't warn. +## Development server Content Security Policy + +The dev server sends its HTML pages and worker scripts with the policy the sandbox shim applies to uploaded apps, as `Content-Security-Policy-Report-Only`: until the shim covers production, it reports what the policy would block and doesn't block it. A policy already on the response, for example from `server.headers`, is kept. The policy would block, among others: + +- classic inline ``, + ``, + '