
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@arcjet/env
Advanced tools
@arcjet/envArcjet environment detection.
Currently operates on an environment object with the type:
type Env = {
FLY_APP_NAME?: string;
NODE_ENV?: string;
ARCJET_KEY?: string;
ARCJET_ENV?: string;
ARCJET_LOG_LEVEL?: string;
ARCJET_BASE_URL?: string;
};
This is a utility that reads configuration for us from process.env and
similar.
It exists so that we can access that configuration throughout our packages.
You should probably not use this but there are some edge cases where we let users swap more advanced features out and then it may be useful.
This package is ESM only. Install with npm in Node.js:
npm install @arcjet/env
import process from "node:process";
import {
apiKey,
baseUrl,
isDevelopment,
logLevel,
platform,
} from "@arcjet/env";
console.log(platform({ FLY_APP_NAME: "foobar" })); // => "fly-io"
console.log(platform({})); // => undefined
console.log(isDevelopment({ NODE_ENV: "production" })); // => false
console.log(isDevelopment({ NODE_ENV: "development" })); // => true
console.log(isDevelopment({ ARCJET_ENV: "production" })); // => false
console.log(isDevelopment({ ARCJET_ENV: "development" })); // => true
console.log(logLevel({ ARCJET_LOG_LEVEL: "debug" })); // => "debug"
console.log(logLevel({ ARCJET_LOG_LEVEL: "info" })); // => "info"
console.log(logLevel({ ARCJET_LOG_LEVEL: "warn" })); // => "warn"
console.log(logLevel({ ARCJET_LOG_LEVEL: "error" })); // => "error"
console.log(logLevel({ ARCJET_LOG_LEVEL: "" })); // => "warn"
console.log(baseUrl(process.env)); // => "https://decide.arcjet.com"
console.log(apiKey({ ARCJET_KEY: "ajkey_abc123" })); // => "ajkey_abc123"
console.log(apiKey({ ARCJET_KEY: "invalid" })); // => undefined
1.0.0-beta.13 (2025-10-07)
protocol detection, minimal request interface (#5270) (51d3bdb)FAQs
Arcjet environment detection
The npm package @arcjet/env receives a total of 14,677 weekly downloads. As such, @arcjet/env popularity was classified as popular.
We found that @arcjet/env demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.