FAQ
Answers to the most common questions.
Why not Zod/Valibot/etc.?
- Confkit ships a tiny runtime focused on configuration use‑cases: URL/port/duration helpers, redaction metadata, client exposure, and sources/expansion built in. You can still transform or refine as needed.
How do I expose values to the client safely?
- Mark them with
.client(). UseloadConfig()orpickClient()to compute aclientEnvobject, then inject via Next/Vite/Expo integrations.
How do I prevent accidental client exposure?
- Set
requireClientPrefix: trueand chooseclientPrefix(es)indefineConfig. This forces.client()keys to start withPUBLIC_(or your chosen prefixes).
Can I compute defaults from other variables?
- Yes, with
expand: trueand${VAR:-fallback}patterns. Usejson(...)to compute structured defaults.
Can I audit when secrets are read?
- Pass an
auditobject todefineConfig. Reads viaconfig.get(key)will emit events.
Does Confkit work on edge runtimes?
- Yes, it avoids Node built‑ins on the hot path. Some features (like
.envfile loading) require Node and only run server‑side.