Skip to content

Instantly share code, notes, and snippets.

@cotyhamilton
Last active October 19, 2022 00:19
Show Gist options
  • Save cotyhamilton/1ed2b9025c51979ec452df4566c69ce6 to your computer and use it in GitHub Desktop.
Save cotyhamilton/1ed2b9025c51979ec452df4566c69ce6 to your computer and use it in GitHub Desktop.
SvelteKit Env Vars - +layout.server.ts
import { env } from "$env/dynamic/private";
import type { LayoutServerLoad } from "./$types";
export const load: LayoutServerLoad = async () => {
return {
configuration: {
environment: env.ENVIRONMENT,
displayEnvironment: env.DISPLAY_ENVIRONMENT?.toLowerCase() === "true"
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment