Skip to main content
InterviewHubPRO
Section Overview
Q41

Question 41 of 50

Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

82%
Svelte & SvelteKit (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

SvelteKit Server-Only Security Boundaries: `$env/static/private` and `+server.ts`.

senior LevelSecurity & AuthSystem DesignSvelte 5

In Simple Words: SvelteKit strictly isolates sensitive secrets:

  • $env/static/private: Compiles environment variables into server bundles. If any client-side file imports from a private environment module, the SvelteKit build immediately throws a compile-time security error.
  • $env/static/public: Only variables prefixed with PUBLIC_ can be sent to client bundles.
  • Standalone API Endpoints (+server.ts): Export HTTP verbs (GET, POST, PUT, DELETE) for REST APIs.