SvelteKit • Reference

$app/env

On this page

This is an alias of $app/environment, used when explicit environment variables are enabled.

import {
	const browser: boolean

true if the app is running in the browser.

const browser: boolean

true if the app is running in the browser.

browser
,
const building: boolean

SvelteKit analyses your app during the build step by running it. During this process, building is true. This also applies during prerendering.

const building: boolean

SvelteKit analyses your app during the build step by running it. During this process, building is true. This also applies during prerendering.

building
,
const dev: boolean

Whether the dev server is running. This is not guaranteed to correspond to NODE_ENV or MODE.

const dev: boolean

Whether the dev server is running. This is not guaranteed to correspond to NODE_ENV or MODE.

dev
,
const version: string

The value of config.kit.version.name.

const version: string

The value of config.kit.version.name.

version
} from '$app/env';

browser

true if the app is running in the browser.

export const browser: boolean;

dev

Whether the dev server is running. This is not guaranteed to correspond to NODE_ENV or MODE.

export const dev: boolean;

building

SvelteKit analyses your app during the build step by running it. During this process, building is true. This also applies during prerendering.

export const building: boolean;

version

The value of config.kit.version.name.

export const version: string;