Barekey is the best way to store, share, and ship secrets.

Secrets are just the start. Barekey also handles feature flags, A/B testing, and rollouts — all fully customizable. Experiment, tweak, and ship features safely with complete control — no redeploys or downtime required.

Get started

import { env } from "@barekey/sdk";

/* known at compile time */
const database_url = env.get("DATABASE_URL");

/* unknown at compile time & needs handling */
const enable_logging = env.get("ENABLE_LOGGING")
    .coerce("boolean")
    .default(false);

/* dynamic enables cache invalidation every 5 minutes */
/* use seed to enable deterministic probability */
const new_dashboard = env.get("NEW_DASHBOARD", {
    dynamic: { 
        ttl: Temporal
            .Duration
            .from({ minutes: 5 })
            .total("milliseconds")
    },
    seed: user.id
});