Skip to main content

$env/dynamic/public

Similar to $env/dynamic/private, but only includes variables that begin with config.kit.env.publicPrefix (which defaults to PUBLIC_), and can therefore safely be exposed to client-side code.

Note that public dynamic environment variables must all be sent from the server to the client, causing larger network requests — when possible, use $env/static/public instead.

import { import envenv } from '$env/dynamic/public';
var console: Consoleconsole.Console.log(...data: any[]): voidlog(import envenv.PUBLIC_DEPLOYMENT_SPECIFIC_VARIABLE);

Edit this page on GitHub llms.txt