What globals and APIs are available inside Vertz server handlers
Vertz server handlers run in a Cloudflare-Workers-compatible JavaScript environment. The same code runs locally under vtz dev and on the edge under vtz deploy — the runtime surface is deliberately aligned with Workers so there is no “works locally, breaks in production” gap.
Calling any of these from a handler throws ReferenceError. That’s intentional — handler code has no DOM to manipulate, and the absence of these globals is what lets third-party SDKs recognize the environment as “not a browser”.
Using third-party SDKs
SDKs that gate on typeof window !== 'undefined' (like @anthropic-ai/sdk, openai, and stripe) work out of the box — no dangerouslyAllowBrowser: true flag required.
import Anthropic from '@anthropic-ai/sdk';import { service } from '@vertz/server';import { s } from '@vertz/schema';export default service('ai', { actions: { summarize: { body: s.object({ text: s.string() }), handler: async ({ text }) => { const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY! }); const message = await client.messages.create({ model: 'claude-haiku-4-5', max_tokens: 256, messages: [{ role: 'user', content: `Summarize: ${text}` }], }); return { summary: message.content }; }, }, },});
If any examples or workarounds you’ve seen use dangerouslyAllowBrowser: true in a Vertz handler,
remove it. That flag disables a safety check that prevents API keys from leaking into client
bundles — it is not needed in a server handler and leaves you exposed if the same file is ever
imported by client code.
SSR vs. handlers
During server-side rendering (SSR) of a page, Vertz transiently installs a DOM shim (document, window, etc.) so the same components that run in the browser can build HTML on the server. That shim is scoped to the render — it is installed before the framework begins rendering the matched route and removed immediately after.Handler code (entity actions, service actions, middleware, auth resolvers, etc.) invoked through the top-level HTTP/API dispatch path runs outside that scope. A handler triggered by a direct request from the browser to /api/..., a form submission, or any non-SSR entry point sees typeof window === 'undefined'.
One edge case: handlers invoked via fetch('/api/...') during SSR
If an SSR render itself calls fetch('/api/...') (for example, a loader or query that runs on the server), the internal fetch interceptor dispatches that request to the handler in-place, while the DOM shim is still installed for the ongoing render. In that path, the handler transiently sees window / document / location.For the SDK-detection problem this is usually harmless — loaders and queries typically read data and don’t construct @anthropic-ai/sdk or openai clients. But if you need a guaranteed-clean environment (e.g. you instantiate an SDK inside a handler that is also reachable from SSR), prefer:
constructing the SDK client at module scope instead of per-request, or
keeping SDK construction in actions that are only called from the client (form submissions, button clicks) rather than SSR loaders.
The direct /api/... request path — which is how form submissions and client-side fetch calls reach handlers in production — always sees the clean environment.
Migrating from older workarounds
If you or a library you depend on added one of the following because of ReferenceError: window is not defined or @anthropic-ai/sdk: It looks like you're running in a browser-like environment, remove it:
dangerouslyAllowBrowser: true on any SDK constructor
globalThis.window = undefined / delete globalThis.window at the top of a handler file
if (typeof window === 'undefined') guards around handler-only code (no longer necessary for correctness — still safe to leave in place)
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Vertz","colors":{"primary":"#3b82f6","light":"#60a5fa","dark":"#2563eb"},"logo":{"light":"https://mintcdn.com/vertz/ubGvUe2sX49avtK_/logo/light.svg?fit=max\u0026auto=format\u0026n=ubGvUe2sX49avtK_\u0026q=85\u0026s=f1730f9011c481d88eb99afdd643673e","dark":"https://mintcdn.com/vertz/ubGvUe2sX49avtK_/logo/dark.svg?fit=max\u0026auto=format\u0026n=ubGvUe2sX49avtK_\u0026q=85\u0026s=8290535b3bd2a9bae7eb0665ed4c72a5"},"favicon":"https://mintcdn.com/vertz/ubGvUe2sX49avtK_/favicon.svg?fit=max\u0026auto=format\u0026n=ubGvUe2sX49avtK_\u0026q=85\u0026s=7fbf8c6d1e5aa3317e14dae6201f6a9d","navbar":{"primary":{"type":"button","label":"Get Started","href":"/quickstart"}},"footer":{"socials":{"github":"https://github.com/vertz-dev/vertz","x":"https://x.com/veraborgesv"}},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/vertz-dev/vertz"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"vertz","hasAudioNarration":false,"actualSubdomain":"vertz","customDomains":["docs.vertz.dev"],"gitSource":{"type":"github","owner":"vertz-dev","repo":"vertz","deployBranch":"main","contentDirectory":"packages/mint-docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae94755f56d237c825bd9f8:success","clientVersion":"0.0.4344","searchFilterCounts":[{"language":"default","tag":"Guides","count":66},{"language":"default","tag":"@vertz/ui","count":25},{"language":"default","tag":"@vertz/server","count":12},{"language":"default","tag":"API Reference","count":11},{"language":"default","tag":"Getting Started","count":10},{"language":"default","tag":"@vertz/db","count":6},{"language":"default","tag":"Deployment","count":5},{"language":"default","tag":"@vertz/agents","count":4},{"language":"default","tag":"Runtime","count":4},{"language":"default","tag":"Testing","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"guides/server/environment","slug":"/guides/server/environment","pageMetadata":{"title":"Runtime Environment","description":"What globals and APIs are available inside Vertz server handlers","href":"/guides/server/environment"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"What globals and APIs are available inside Vertz server handlers\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Vertz server handlers run in a Cloudflare-Workers-compatible JavaScript environment. The same code runs locally under `,_jsx(_components.code,{children:`vtz dev`}),` and on the edge under `,_jsx(_components.code,{children:`vtz deploy`}),` — the runtime surface is deliberately aligned with Workers so there is no “works locally, breaks in production” gap.`]}),`\n`,_jsx(Heading,{level:`2`,id:`what’s-available`,children:`What’s available`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Network + data:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`fetch`}),`, `,_jsx(_components.code,{children:`Request`}),`, `,_jsx(_components.code,{children:`Response`}),`, `,_jsx(_components.code,{children:`Headers`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`URL`}),`, `,_jsx(_components.code,{children:`URLSearchParams`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`AbortController`}),`, `,_jsx(_components.code,{children:`AbortSignal`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`FormData`}),`, `,_jsx(_components.code,{children:`Blob`}),`, `,_jsx(_components.code,{children:`ReadableStream`}),`, `,_jsx(_components.code,{children:`WritableStream`}),`, `,_jsx(_components.code,{children:`TransformStream`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`TextEncoder`}),`, `,_jsx(_components.code,{children:`TextDecoder`})]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Timers + scheduling:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`setTimeout`}),`, `,_jsx(_components.code,{children:`setInterval`}),`, `,_jsx(_components.code,{children:`clearTimeout`}),`, `,_jsx(_components.code,{children:`clearInterval`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`queueMicrotask`}),`, `,_jsx(_components.code,{children:`performance.now()`})]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Crypto:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`crypto.randomUUID()`}),`, `,_jsx(_components.code,{children:`crypto.getRandomValues()`}),`, `,_jsx(_components.code,{children:`crypto.subtle`})]}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Environment identification:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`navigator.userAgent`}),` — identifies the Vertz server runtime (useful for `,_jsx(_components.code,{children:`User-Agent`}),` headers on outbound `,_jsx(_components.code,{children:`fetch`}),`)`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Standard ECMAScript:`}),` `,_jsx(_components.code,{children:`Promise`}),`, `,_jsx(_components.code,{children:`Map`}),`, `,_jsx(_components.code,{children:`Set`}),`, `,_jsx(_components.code,{children:`WeakMap`}),`, `,_jsx(_components.code,{children:`WeakSet`}),`, `,_jsx(_components.code,{children:`Intl`}),`, `,_jsx(_components.code,{children:`JSON`}),`, etc.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Vertz APIs:`}),` everything in `,_jsx(_components.code,{children:`@vertz/server`}),` (`,_jsx(_components.code,{children:`entity`}),`, `,_jsx(_components.code,{children:`service`}),`, `,_jsx(_components.code,{children:`rules`}),`, etc.), `,_jsx(_components.code,{children:`@vertz/db`}),`, `,_jsx(_components.code,{children:`@vertz/schema`}),`, and `,_jsx(_components.code,{children:`@vertz/errors`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`what’s-not-available`,children:`What’s not available`}),`\n`,_jsxs(_components.p,{children:[`Server handlers do `,_jsx(_components.strong,{children:`not`}),` expose browser globals:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`window`}),`, `,_jsx(_components.code,{children:`document`}),`, `,_jsx(_components.code,{children:`HTMLElement`}),`, `,_jsx(_components.code,{children:`Element`}),`, `,_jsx(_components.code,{children:`Node`}),`, and other DOM types`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`location`}),`, `,_jsx(_components.code,{children:`history`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`localStorage`}),`, `,_jsx(_components.code,{children:`sessionStorage`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`MutationObserver`}),`, `,_jsx(_components.code,{children:`ResizeObserver`}),`, `,_jsx(_components.code,{children:`IntersectionObserver`})]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Calling any of these from a handler throws `,_jsx(_components.code,{children:`ReferenceError`}),`. That’s intentional — handler code has no DOM to manipulate, and the absence of these globals is what lets third-party SDKs recognize the environment as “not a browser”.`]}),`\n`,_jsx(Heading,{level:`2`,id:`using-third-party-sdks`,children:`Using third-party SDKs`}),`\n`,_jsxs(_components.p,{children:[`SDKs that gate on `,_jsx(_components.code,{children:`typeof window !== 'undefined'`}),` (like `,_jsx(_components.code,{children:`@anthropic-ai/sdk`}),`, `,_jsx(_components.code,{children:`openai`}),`, and `,_jsx(_components.code,{children:`stripe`}),`) work out of the box — no `,_jsx(_components.code,{children:`dangerouslyAllowBrowser: true`}),` flag required.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`20`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`20`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Anthropic`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@anthropic-ai/sdk'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`service`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@vertz/server'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`s`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@vertz/schema'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` default`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` service`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'ai'`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` actions:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` summarize:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` s`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`object`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`text:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` s`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() }),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` handler`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ({ `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`text`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` client`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Anthropic`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apiKey:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`ANTHROPIC_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` message`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`messages`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'claude-haiku-4-5'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` max_tokens:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 256`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` messages:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [{ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`role:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'user'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `Summarize: \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`text`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`summary:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`content`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` };`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`})`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`If any examples or workarounds you’ve seen use `,_jsx(_components.code,{children:`dangerouslyAllowBrowser: true`}),` in a Vertz handler,\nremove it. That flag disables a safety check that prevents API keys from leaking into client\nbundles — it is not needed in a server handler and leaves you exposed if the same file is ever\nimported by client code.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`ssr-vs-handlers`,children:`SSR vs. handlers`}),`\n`,_jsxs(_components.p,{children:[`During server-side rendering (SSR) of a page, Vertz transiently installs a DOM shim (`,_jsx(_components.code,{children:`document`}),`, `,_jsx(_components.code,{children:`window`}),`, etc.) so the same components that run in the browser can build HTML on the server. That shim is scoped to the render — it is installed before the framework begins rendering the matched route and removed immediately after.`]}),`\n`,_jsxs(_components.p,{children:[`Handler code (entity actions, service actions, middleware, auth resolvers, etc.) invoked through the top-level HTTP/API dispatch path runs `,_jsx(_components.strong,{children:`outside`}),` that scope. A handler triggered by a direct request from the browser to `,_jsx(_components.code,{children:`/api/...`}),`, a form submission, or any non-SSR entry point sees `,_jsx(_components.code,{children:`typeof window === 'undefined'`}),`.`]}),`\n`,_jsxs(Heading,{level:`3`,id:`one-edge-case-handlers-invoked-via-fetch-/api/-during-ssr`,children:[`One edge case: handlers invoked via `,_jsx(_components.code,{children:`fetch('/api/...')`}),` during SSR`]}),`\n`,_jsxs(_components.p,{children:[`If an SSR render itself calls `,_jsx(_components.code,{children:`fetch('/api/...')`}),` (for example, a loader or query that runs on the server), the internal fetch interceptor dispatches that request to the handler `,_jsx(_components.strong,{children:`in-place`}),`, while the DOM shim is still installed for the ongoing render. In that path, the handler transiently sees `,_jsx(_components.code,{children:`window`}),` / `,_jsx(_components.code,{children:`document`}),` / `,_jsx(_components.code,{children:`location`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`For the SDK-detection problem this is usually harmless — loaders and queries typically read data and don’t construct `,_jsx(_components.code,{children:`@anthropic-ai/sdk`}),` or `,_jsx(_components.code,{children:`openai`}),` clients. But if you need a guaranteed-clean environment (e.g. you instantiate an SDK inside a handler that is also reachable from SSR), prefer:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`constructing the SDK client at module scope instead of per-request, or`}),`\n`,_jsx(_components.li,{children:`keeping SDK construction in actions that are only called from the client (form submissions, button clicks) rather than SSR loaders.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The direct `,_jsx(_components.code,{children:`/api/...`}),` request path — which is how form submissions and client-side `,_jsx(_components.code,{children:`fetch`}),` calls reach handlers in production — always sees the clean environment.`]}),`\n`,_jsx(Heading,{level:`2`,id:`migrating-from-older-workarounds`,children:`Migrating from older workarounds`}),`\n`,_jsxs(_components.p,{children:[`If you or a library you depend on added one of the following because of `,_jsx(_components.code,{children:`ReferenceError: window is not defined`}),` or `,_jsx(_components.code,{children:`@anthropic-ai/sdk: It looks like you're running in a browser-like environment`}),`, remove it:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`dangerouslyAllowBrowser: true`}),` on any SDK constructor`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`globalThis.window = undefined`}),` / `,_jsx(_components.code,{children:`delete globalThis.window`}),` at the top of a handler file`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`if (typeof window === 'undefined')`}),` guards around handler-only code (no longer necessary for correctness — still safe to leave in place)`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Runtime Environment","description":"What globals and APIs are available inside Vertz server handlers","href":"/guides/server/environment"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"What’s available","slug":"what’s-available","depth":2,"children":[]},{"title":"What’s not available","slug":"what’s-not-available","depth":2,"children":[]},{"title":"Using third-party SDKs","slug":"using-third-party-sdks","depth":2,"children":[]},{"title":"SSR vs. handlers","slug":"ssr-vs-handlers","depth":2,"children":[{"title":"One edge case: handlers invoked via fetch('/api/...') during SSR","slug":"one-edge-case-handlers-invoked-via-fetch-/api/-during-ssr","depth":3,"children":[]}]},{"title":"Migrating from older workarounds","slug":"migrating-from-older-workarounds","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"vertz","siteName":"Vertz","title":"Runtime Environment - Vertz","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-04-19T16:43:06.085Z","originalFileLocation":"guides/server/environment.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"What globals and APIs are available inside Vertz server handlers\">\u003cmeta data-mint-head name=\"application-name\" content=\"Vertz\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/vertz/DiOki4day3amAbsT/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/vertz/DiOki4day3amAbsT/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/vertz/DiOki4day3amAbsT/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/vertz/DiOki4day3amAbsT/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/vertz/DiOki4day3amAbsT/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/vertz/DiOki4day3amAbsT/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/vertz/DiOki4day3amAbsT/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/vertz/DiOki4day3amAbsT/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/vertz/DiOki4day3amAbsT/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Runtime Environment - Vertz\">\u003cmeta data-mint-head property=\"og:description\" content=\"What globals and APIs are available inside Vertz server handlers\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Vertz\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.vertz.dev/guides/server/environment\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://vertz.mintlify.site/_mintlify/api/og/v2?division=%40vertz%2Fserver\u0026amp;title=Runtime+Environment\u0026amp;description=What+globals+and+APIs+are+available+inside+Vertz+server+handlers\u0026amp;theme=bbecb71b51769832e67f96ca\u0026amp;signature=f7804e754ae6aeedc5748540da948d15697ea8a65095417bc04aea6350574b83\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Runtime Environment - Vertz\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"What globals and APIs are available inside Vertz server handlers\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://vertz.mintlify.site/_mintlify/api/og/v2?division=%40vertz%2Fserver\u0026amp;title=Runtime+Environment\u0026amp;description=What+globals+and+APIs+are+available+inside+Vertz+server+handlers\u0026amp;theme=bbecb71b51769832e67f96ca\u0026amp;signature=f7804e754ae6aeedc5748540da948d15697ea8a65095417bc04aea6350574b83\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/vertz/DiOki4day3amAbsT/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Vertz\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3b82f6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.vertz.dev/guides/server/environment\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/server/environment.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.vertz.dev/#organization\",\"name\":\"Vertz\",\"url\":\"https://docs.vertz.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/vertz/ubGvUe2sX49avtK_/logo/light.svg?fit=max\u0026auto=format\u0026n=ubGvUe2sX49avtK_\u0026q=85\u0026s=f1730f9011c481d88eb99afdd643673e\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.vertz.dev#website\",\"name\":\"Vertz\",\"url\":\"https://docs.vertz.dev\",\"publisher\":{\"@id\":\"https://docs.vertz.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.vertz.dev/guides/server/environment#webpage\",\"url\":\"https://docs.vertz.dev/guides/server/environment\",\"name\":\"Runtime Environment\",\"description\":\"What globals and APIs are available inside Vertz server handlers\",\"dateModified\":\"2026-04-19T16:43:06.085Z\",\"isPartOf\":{\"@id\":\"https://docs.vertz.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.vertz.dev/guides/server/environment#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.vertz.dev/guides/server/environment#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"@vertz/server\",\"item\":\"https://docs.vertz.dev/guides/server/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Runtime Environment\",\"item\":\"https://docs.vertz.dev/guides/server/environment\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.vertz.dev/guides/server/environment#article\",\"headline\":\"Runtime Environment\",\"name\":\"Runtime Environment\",\"description\":\"What globals and APIs are available inside Vertz server handlers\",\"url\":\"https://docs.vertz.dev/guides/server/environment\",\"mainEntityOfPage\":{\"@id\":\"https://docs.vertz.dev/guides/server/environment#webpage\"},\"dateModified\":\"2026-04-19T16:43:06.085Z\",\"publisher\":{\"@id\":\"https://docs.vertz.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.vertz.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Vertz\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Vertz\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/guides/server/environment.md","siteName":"Vertz","nav":{"global":{"anchors":[{"anchor":"GitHub","icon":"github","href":"https://github.com/vertz-dev/vertz"}]},"tabs":[{"tab":"Guides","groups":[{"group":"Getting Started","pages":[{"title":"Introduction","href":""},{"title":"Quickstart","href":"/quickstart"},{"title":"Installation","href":"/installation"},{"title":"Runtime","href":"/runtime"},{"title":"Project Structure","href":"/project-structure"},{"title":"Conventions","href":"/conventions"},{"title":"Philosophy","href":"/philosophy"},{"title":"LLM Quick Reference","href":"/guides/llm-quick-reference"},{"title":"Common Mistakes","href":"/guides/common-mistakes"},{"title":"Configuration","href":"/guides/configuration"}]},{"group":"@vertz/ui","pages":[{"title":"Overview","href":"/guides/ui/overview"},{"title":"Components","href":"/guides/ui/components"},{"title":"Component Library","href":"/guides/ui/component-library"},{"title":"Raw HTML Injection","href":"/guides/ui/raw-html"},{"title":"Reactivity","href":"/guides/ui/reactivity"},{"title":"Styling","href":"/guides/ui/styling"},{"title":"Routing","href":"/guides/ui/routing"},{"title":"Data Fetching","href":"/guides/ui/data-fetching"},{"title":"Live Data (Streams)","href":"/guides/ui/live-data"},{"title":"Auto Field Selection","href":"/guides/ui/auto-field-selection"},{"title":"Forms","href":"/guides/ui/forms"},{"title":"Authentication","href":"/guides/ui/auth"},{"title":"Multi-Tenancy","href":"/guides/ui/multi-tenancy"},{"title":"Server-Side Rendering","href":"/guides/ui/ssr"},{"title":"Access Control","href":"/guides/ui/access-control"}]},{"group":"@vertz/ui-compiler","pages":[{"title":"Compiler Plugin","href":"/guides/ui/compiler"}]},{"group":"@vertz/icons","pages":[{"title":"Icons","href":"/guides/ui/icons"}]},{"group":"@vertz/schema","pages":[{"title":"Schema","href":"/guides/schema"}]},{"group":"@vertz/errors","pages":[{"title":"Errors","href":"/guides/errors"}]},{"group":"@vertz/server","pages":[{"title":"Overview","href":"/guides/server/overview"},{"title":"Entities","href":"/guides/server/entities"},{"title":"Domains","href":"/guides/server/domains"},{"title":"Fields, Relations \u0026 Filters","href":"/guides/server/entity-exposure"},{"title":"Authentication \u0026 Access Control","href":"/guides/server/auth"},{"title":"Multi-Tenancy","href":"/guides/server/multi-tenancy"},{"title":"Code Generation","href":"/guides/server/codegen"},{"title":"OAuth Providers","href":"/guides/server/oauth"},{"title":"Services","description":"Standalone operations and cross-entity workflows","href":"/guides/server/services"},{"title":"Runtime Environment","href":"/guides/server/environment"},{"title":"Environment Variables","description":"Validate and type-check environment variables with createEnv()","href":"/guides/env"},{"title":"HMR Types (`import.meta.hot`)","href":"/guides/hmr-types"}]},{"group":"@vertz/agents","pages":[{"title":"Overview","href":"/guides/agents/overview"},{"title":"Workflows","href":"/guides/agents/workflows"},{"title":"Durable resume","href":"/guides/agents/durable-resume"},{"title":"Entity bridge (RLS for agent data)","href":"/guides/agents/entity-bridge"}]},{"group":"@vertz/db","pages":[{"title":"Overview","href":"/guides/db/overview"},{"title":"Schema","href":"/guides/db/schema"},{"title":"Queries","href":"/guides/db/queries"},{"title":"Migrations","href":"/guides/db/migrations"},{"title":"Introspection","href":"/guides/db/introspection"},{"title":"Seeding","href":"/guides/db/seeding"}]},{"group":"@vertz/desktop","pages":[{"title":"File System","href":"/guides/desktop/fs"}]},{"group":"@vertz/fetch","pages":[{"title":"SDK \u0026 Fetch Client","href":"/guides/fetch"}]},{"group":"@vertz/openapi","pages":[{"title":"OpenAPI SDK Generator","href":"/guides/openapi"}]},{"group":"Deployment","pages":[{"title":"Cloudflare Workers","href":"/guides/deploy/cloudflare"},{"title":"Node.js","href":"/guides/deploy/node"},{"title":"Static Sites","href":"/guides/deploy/static-sites"},{"title":"Static Site Generation (SSG)","href":"/guides/deploy/ssg"},{"title":"OG Images","href":"/guides/deploy/og-images"}]},{"group":"Testing","pages":[{"title":"Test Runner","href":"/guides/testing-unit"},{"title":"Server Testing","href":"/guides/testing-server"},{"title":"E2E Testing","href":"/guides/testing-e2e"}]},{"group":"Runtime","pages":[{"title":"Debugging with Chrome DevTools","href":"/guides/debugging"},{"title":"Dev Server Tools for AI Agents","href":"/guides/dev-server-tools"},{"title":"Reading and Writing Files","href":"/guides/fs"},{"title":"Spawning Processes","href":"/guides/child-process"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/fetch/sdk"}]},{"tab":"Examples","pages":[{"title":"Examples","href":"/examples/task-manager"}]}]},"basePath":"","title":"Runtime Environment - Vertz","deploymentId":"dpl_EwfxjeKENdVkfzdag8rM6mKzcTUJ","buildId":"dpl_EwfxjeKENdVkfzdag8rM6mKzcTUJ","dynamics":[],"chunks":[]}