Svelte · Senior · Question 46 of 75
Where should private environment variables be read in SvelteKit 3?
- ✓Correct answer: From
$app/env/private, which can only be imported in server-only code; the older$env/*modules are deprecated - 2From
import.meta.envin components - 3From
window.env
Explanation
Importing private env into client code fails the build, the same protection as for .server modules.