Object with both private and public env vars

#15414

Development PR

Issue

Solved
S
Stadly
Feb 24, 2026, 9:52 PM

Describe the problem

I often need both a private and a public env var on the server, so I have to do something like this which is a bit tedious:

import { env as privateEnv } from "$env/dynamic/private";
import { env as publicEnv } from "$env/dynamic/public";

Describe the proposed solution

Either include the public env vars in $env/dynamic/private, or create common import { env } from "$env/dynamic" that is only usable on the server and includes both private and public env vars.

Alternatives considered

No response

Importance

nice to have

Additional Information

Related:

Info

Closed at Jun 6, 2026, 8:29 AM
Assignees None
Labels breaking change
Milestone 3.0

Pro tip: You can prefix GitHub URLs of issues, PRs or discussions with svcl.dev/ to view them on this page! Also try it on a GitHub release ;)