Editor integration

Configure autocomplete, type inspection, and diagnostics in your editor.

Edit on GitHub

ArkType schema strings are still strings to the TypeScript language service. ArkEnv keeps them highlighted in the editor, and TypeScript infers keys on env from the same declaration you validate at runtime.

Syntax highlighting and inline type errors

ArkType schema strings are still strings to the TypeScript language service. The ArkType VS Code extension and JetBrains plugin highlight those strings and report type errors inline, so a bad number.port shows up before you run the app.

The extension highlights calls whose name contains ark. Keep the default import name arkenv:

./env.ts
- import createEnv from "@arkenv/core";
+ import arkenv from "@arkenv/core";

- export const env = createEnv({
+ export const env = arkenv({
    PORT: "number.port = 3000",
    DEBUG: "boolean = false",
  });

ArkType only

Skip this section and ArkThemes if you validate with @arkenv/standard. ArkType editor tools do not apply to Zod, Valibot, etc.

ArkThemes

The extension highlights syntax. ArkThemes colors those strings so they read like TypeScript, in light and dark mode, in VS Code and Cursor.

Visit the VS Code Marketplace to install.

Autocomplete on env.*

Once the schema typechecks, env. completes with the keys you declared and the types ArkEnv inferred. That only holds when application code imports env. Reading process.env skips both the check and the completion list.

./server.ts
import {  } from "./env";

console.log(`Server is running on port ${.PORT}`);
Always use env.PORT rather than process.env.PORT to preserve typesafety.