Before you write a feature, you write the plumbing: read config, don’t crash on a missing key, stop someone hammering your login, hide a half-finished feature behind a flag. WebKit is that plumbing, packaged.

Four packages

- @lacspace/env — typed, validated configuration, checked at boot.
- @lacspace/rate-limit — protect routes; in-memory or a shared store.
- @lacspace/flags — feature flags and gradual rollouts.
- @lacspace/next — Next.js route and header helpers.
Fail at boot, not at 2am
import { env, url, port } from '@lacspace/env';
export const cfg = env({ DATABASE_URL: url(), PORT: port().default(3000) });
// missing/blank DATABASE_URL? the process refuses to start — with a clear message
Get started
Browse WebKit at lacspace.com/packages and read the API at lacspace.com/docs. It pairs with the Security Kit and the rest of the ecosystem.
Frequently asked questions
What is WebKit?
WebKit is Lacspace’s set of utilities every web app and backend re-implements: @lacspace/env (typed, validated configuration), @lacspace/rate-limit (rate limiting for routes), @lacspace/flags (feature flags) and @lacspace/next (Next.js route and header helpers). Zero dependencies, isomorphic.
Why validate environment variables?
Because a missing or malformed env var should fail loudly at boot, not mysteriously at 2am. @lacspace/env parses and validates process.env against a typed schema when your app starts, so misconfiguration is caught immediately and the rest of your code gets fully-typed config.
Does the rate limiter need Redis?
No — it works in-memory out of the box and can plug into a shared store (like Redis) when you scale horizontally. Protect an auth or API route in a couple of lines.
What does @lacspace/next add?
Small, sharp helpers for the Next.js App Router — building responses, setting security headers, and wiring the other Lacspace packages into routes cleanly.








