
Security News
pnpm 12’s Rust Rewrite Cuts Install Times by Up to 90%
pnpm 12 rewrites the package manager in Rust, cutting install times by up to 90% while preserving pnpm 11 workflows and lockfiles.
@arcjet/env
Advanced tools
@arcjet/envArcjet environment detection.
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 { 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"
This package exports the identifiers
baseUrl,
isDevelopment,
logLevel, and
platform.
There is no default export.
This package exports the TypeScript types
Env and
Platform.
EnvThis type represents the environment object that you pass to the functions in this package. It includes known Arcjet and platform-specific environment variables.
export type Env = {
[key: string]: unknown;
ARCJET_BASE_URL?: string | undefined;
ARCJET_ENV?: string | undefined;
ARCJET_LOG_LEVEL?: string | undefined;
FIREBASE_CONFIG?: string | undefined;
FLY_APP_NAME?: string | undefined;
MODE?: string | undefined;
NODE_ENV?: string | undefined;
RENDER?: string | undefined;
VERCEL?: string | undefined;
};
PlatformThis type represents the platform names that can be detected.
type Platform = "firebase" | "fly-io" | "render" | "vercel";
baseUrl(environment)Returns the base URL for the Arcjet API. You can use this if you need to know which API endpoint Arcjet will talk to.
environment (Env)
— the environment object, typically process.envBase URL of the Arcjet API (string).
isDevelopment(environment)Checks whether the current environment is a development environment. We use this internally to adjust behavior between development and production.
environment (Env)
— the environment object, typically process.envWhether the environment is development (boolean).
logLevel(environment)Returns the configured log level from the environment. If no log level is
set, it defaults to "warn".
environment (Env)
— the environment object, typically process.envLog level ("debug" | "error" | "info" | "warn").
platform(environment)Detects which platform your code is running on based on environment variables.
environment (Env)
— the environment object, typically process.envName of the platform if found (Platform), or undefined
otherwise.
FAQs
Arcjet environment detection
The npm package @arcjet/env receives a total of 69,086 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 2 open source maintainers collaborating on the project.

Security News
pnpm 12 rewrites the package manager in Rust, cutting install times by up to 90% while preserving pnpm 11 workflows and lockfiles.

Security News
Socket CTO Ahmad Nassri joins AppSec leaders at Black Hat to discuss active malware, package manager risks, and software supply chain defense.

Research
/Security News
Thirteen malicious Packagist themes expose visitors on unpatched iPhones to a WebKit-to-kernel exploit chain that steals device data and wallet seeds.