> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# next-server-env-in-client

> A 'use client' file reads a process.env variable without the NEXT_PUBLIC_ prefix, so it is unavailable in the browser by default.

## What it flags

A file starting with `'use client'` reads `process.env.X` where `X` does not start with `NEXT_PUBLIC_` (`NODE_ENV` is exempt), so the value is `undefined` in the browser. The rule handles optional access and static bracket notation such as `process['env'].X`. Reads guarded by short-circuit evaluation or inside a `typeof window === 'undefined'` branch are not reported, including when the guard carries a type or non-null assertion.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "next-server-env-in-client": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.