Skip to main content
Keyflare is a self-hosted secrets manager that runs as a single Cloudflare Worker backed by a single D1 database.

Core Principles

  1. Single deployment target — One Worker, one D1 database, one master secret
  2. Zero trust storage — Secret keys and values are encrypted at rest
  3. Minimal surface area — No users, no sessions, no OAuth
  4. Simple mental model — Projects → Environments → Secrets

Infrastructure

Total infrastructure: 1 Worker + 1 D1 database + 1 secret

Data Model

Projects

A project is a namespace for secrets (e.g., my-api, frontend-app).

Environments

Each project has environments (e.g., production, staging, development). New projects get dev and prod environments by default. Project and environment names are case-insensitive.

Secrets

Key-value pairs stored per environment. Both key names and values are encrypted with AES-256-GCM.

API Keys

Two types:
  • User keys (kfl_user_*) — Full admin access
  • System keys (kfl_sys_*) — Scoped to specific project:environment pairs

Request Flow

kfl init flow

Authorization Flow

Monorepo Structure

NPM Package Bundling

When published, the @keyflare/cli package bundles the server code:
This allows kfl init to deploy the Worker without requiring users to clone the repository.

Technology Stack