# Using Krypt in CI/CD Source: https://docs.krypthq.com/cli/ci-cd Inject Krypt-managed secrets into your CI/CD pipelines The Krypt CLI works the same in CI as it does on your laptop. Generate an API key, store it as a CI secret, and use `krypt pull` or `krypt run` in your pipeline to inject secrets without committing `.env` files. ## Generate a CI-specific API key Create a separate API key for each CI environment. This lets you revoke a single key without disrupting other pipelines. **1. Open the API keys page** Go to [krypthq.com/dashboard/api-keys](https://krypthq.com/dashboard/api-keys). **2. Generate a new key** Click **Generate Key** and name it descriptively — e.g. "github-actions-staging", "gitlab-production", "vercel-preview". **3. Copy the key** Copy the key (starts with `krypt_live_`). It's shown only once. **4. Store in your CI provider** Add the key as a secret/variable in your CI provider's settings. Never hardcode it in your pipeline file. > [!TIP] > > Use one key per environment per CI provider. If your staging CI is compromised, you revoke only that key — production keeps running. ## GitHub Actions > [tab] Pull secrets to .env > > Write secrets to `.env` before your build step: > > ```yaml theme={null} > name: Deploy > on: [push] > jobs: > deploy: > runs-on: ubuntu-latest > steps: > - uses: actions/checkout@v4 > - uses: actions/setup-node@v4 > with: > node-version: 20 > - run: npm install -g @kryptorg/cli > - run: krypt login --key ${{ secrets.KRYPT_API_KEY }} > - run: krypt pull --env production > - run: npm run build > ``` > [tab] Inject directly (no .env file) > > Use `krypt run` to inject secrets into a single command without writing to disk: > > ```yaml theme={null} > name: Deploy > on: [push] > jobs: > deploy: > runs-on: ubuntu-latest > steps: > - uses: actions/checkout@v4 > - uses: actions/setup-node@v4 > with: > node-version: 20 > - run: npm install -g @kryptorg/cli > - run: krypt login --key ${{ secrets.KRYPT_API_KEY }} > - run: krypt run --env production -- npm run deploy > ``` > [!NOTE] > > Store `KRYPT_API_KEY` as a GitHub Actions secret: Repository → Settings → Secrets and variables → Actions → New repository secret. ## GitLab CI Same pattern in `.gitlab-ci.yml`: ```yaml theme={null} deploy: image: node:20 stage: deploy script: - npm install -g @kryptorg/cli - krypt login --key $KRYPT_API_KEY - krypt pull --env production - npm run build - npm run deploy ``` Store `KRYPT_API_KEY` in GitLab: Settings → CI/CD → Variables. Mark it as **masked** and **protected** for production branches. ## Vercel deployments Vercel doesn't run arbitrary CI steps during its build process. Two options: **Option 1 — Build command override** In your `vercel.json` or project settings, set the build command to install Krypt and pull secrets before building: ```json theme={null} { "buildCommand": "npm install -g @kryptorg/cli && krypt login --key $KRYPT_API_KEY && krypt pull --env production && npm run build" } ``` Add `KRYPT_API_KEY` as an environment variable in your Vercel project settings. **Option 2 — Separate CI job** Use GitHub Actions (or another CI) to pull secrets and deploy to Vercel: ```yaml theme={null} - run: krypt pull --env production - run: vercel deploy --prod --token $VERCEL_TOKEN ``` > [!NOTE] > > For most Vercel projects, adding env vars directly in the Vercel dashboard is simpler. Use Krypt's CI integration when you manage many environments or want centralized secrets across multiple platforms. ## Other CI providers The same pattern works everywhere: install the CLI, login with a stored API key, pull or run. | Provider | Secret storage | Install step | | - | - | - | | CircleCI | Project Settings → Environment Variables | `run: npm install -g @kryptorg/cli` | | Jenkins | Credentials → Secret text | `sh 'npm install -g @kryptorg/cli'` | | Bitbucket Pipelines | Repository settings → Pipelines → Variables | `- npm install -g @kryptorg/cli` | ## Security best practices > [!WARNING] > > Follow these rules to keep your CI pipelines secure: > > * **Never echo secrets to logs** — avoid `printenv`, `echo $SECRET`, or verbose build flags that dump env vars > * **Scope keys to environments** — production keys should only exist on production deploy jobs > * **Rotate keys regularly** — regenerate CI keys from the dashboard on a schedule (monthly or quarterly) > * **Revoke immediately if compromised** — if a CI environment is breached, revoke its key instantly from the dashboard > * **Use a unique key per CI environment** — never share keys across staging and production ## Troubleshooting ### "Not authenticated" in CI **Cause:** The `KRYPT_API_KEY` secret is not set, misspelled, or not accessible to the job. **Fix:** Verify the secret name in your CI settings matches what's in your YAML exactly. In GitHub Actions, check that the secret is available to the repository (not just the organization level). In GitLab, check variable scope and protected branch settings. ### Secrets pulled but missing in next step **Cause:** Each CI step runs in a fresh shell. Environment variables exported in one step don't carry to the next. **Fix:** Either use `krypt run` to wrap the command that needs secrets, or use `krypt pull` to write a `.env` file that your application loads at startup (via `dotenv` or your framework's env loading). ### Rate limiting in CI **Cause:** High-frequency CI runs hitting Krypt's rate limit (600 requests per 15 minutes per API key). **Fix:** Cache the pulled `.env` file between steps so you only call `krypt pull` once per job. If you need higher limits, contact [hello@krypthq.com](mailto:hello@krypthq.com). # CLI commands Source: https://docs.krypthq.com/cli/commands Every command and option in the Krypt CLI Full reference for the Krypt CLI (`@kryptorg/cli` v2.1.1). If you're new to Krypt, start with the [Quickstart](/quickstart). ## krypt login Authenticates the CLI with your Krypt account using an API key. ### Usage ```bash theme={null} krypt login --key ``` ### Options | Flag | Description | Default | | - | - | - | | `--key` | Your API key (starts with `krypt_live_`) | — | ### Examples ```bash theme={null} krypt login --key krypt_live_abc123def456 ``` ```bash theme={null} KRYPT_API_URL=https://custom.krypthq.com krypt login --key krypt_live_abc123def456 ``` > [!NOTE] > > Your API key is stored in `~/.krypt/config.json` with `0600` permissions. Generate keys at [krypthq.com/dashboard/api-keys](https://www.krypthq.com/dashboard/api-keys). Keys are shown only once — store them somewhere safe. *** ## krypt logout Removes your stored credentials by clearing `~/.krypt/config.json`. ### Usage ```bash theme={null} krypt logout ``` ### Examples ```bash theme={null} krypt logout ``` ```text theme={null} ✓ Logged out and config cleared ``` *** ## krypt whoami Displays the currently authenticated user and their associated projects. ### Usage ```bash theme={null} krypt whoami ``` ### Examples ```bash theme={null} krypt whoami ``` ```text theme={null} Account User ID: user_3D5IGYf50BLotX62fK5NjFHU7sR (Email unavailable — API keys don't carry identity by default) API Key: krypt_live_abc12... Projects (2) my-app updated 5/5/2026, 14:30:00 billing updated 5/4/2026, 10:15:00 ``` > [!NOTE] > > When authenticated via API key, email is unavailable because keys don't carry user identity. Use the dashboard to see your full account details. *** ## krypt list Lists all projects in your Krypt account. ### Usage ```bash theme={null} krypt list ``` `ls` is an alias: ```bash theme={null} krypt ls ``` ### Examples ```bash theme={null} krypt list ``` ```text theme={null} Projects (3): my-app updated 5/5/2026, 14:30:00 billing updated 5/4/2026, 10:15:00 infra updated 5/3/2026, 09:00:00 ``` *** ## krypt init Links the current directory to a Krypt project. Creates a `.krypt` config file in the directory. ### Usage ```bash theme={null} krypt init [options] ``` ### Options | Flag | Description | Default | | - | - | - | | `--env` | Environment to use for this directory | `development` | ### Examples ```bash theme={null} krypt init my-app ``` ```bash theme={null} krypt init my-app --env staging ``` ```text theme={null} ✓ Linked to "my-app" (staging) Created .krypt ``` > [!NOTE] > > Add `.krypt` to your `.gitignore` — it contains your project binding but should not be shared across clones. *** ## krypt push Uploads your local `.env` file to Krypt over TLS. Secrets are encrypted with AES-256 at rest on the server. ### Usage ```bash theme={null} krypt push [options] ``` ### Options | Flag | Description | Default | | - | - | - | | `--env` | Target environment to push to | Environment set by `krypt init` | ### Examples ```bash theme={null} krypt push ``` ```bash theme={null} krypt push --env production ``` ```text theme={null} ✓ Pushed 5 secret(s) to "my-app" (production) ``` > [!WARNING] > > Pushing overwrites all secrets in the target environment. There is no merge — the remote state becomes an exact copy of your local `.env`. *** ## krypt pull Downloads secrets from Krypt and writes them to `.env` in the current directory. ### Usage ```bash theme={null} krypt pull [options] ``` ### Options | Flag | Description | Default | | - | - | - | | `--env` | Environment to pull from | Environment set by `krypt init` | ### Examples ```bash theme={null} krypt pull ``` ```bash theme={null} krypt pull --env staging ``` ```text theme={null} ✓ Pulled 5 secret(s) from "my-app" (staging) Written to .env ``` > [!NOTE] > > If a `.env` file already exists, it is overwritten. Back up local changes before pulling if needed. Every pull is recorded in the project's audit log: who pulled, which environment, how many secrets, and that it came from the CLI. The values themselves are never logged. The same goes for `krypt run` and `krypt diff`. See [Encryption and security](/concepts/encryption-and-security#audit-log). *** ## krypt run Executes a command with your project's secrets injected as environment variables. No `.env` file is written to disk. ### Usage ```bash theme={null} krypt run [options] -- ``` ### Options | Flag | Description | Default | | - | - | - | | `--env` | Environment to load secrets from | Environment set by `krypt init` | ### Examples ```bash theme={null} krypt run -- node server.js ``` ```bash theme={null} krypt run --env production -- npm start ``` ```bash theme={null} krypt run -- printenv DATABASE_URL ``` > [!TIP] > > Your shell expands `$VAR` before Krypt sees it. If your command includes literal dollar signs, wrap it in single quotes: > > ```bash theme={null} > krypt run -- sh -c 'echo $DATABASE_URL' > ``` *** ## krypt diff Compares secrets between two environments of the same project. Displays a colour-coded side-by-side table showing matching, mismatched, and missing keys. ### Usage ```bash theme={null} krypt diff --envA --envB ``` ### Options | Flag | Description | Default | | - | - | - | | `--envA` | First environment to compare | — (required) | | `--envB` | Second environment to compare | — (required) | ### Examples ```bash theme={null} krypt diff my-app --envA development --envB production ``` ```text theme={null} my-app development ↔ production ────────────────────────────────────────────────────────────────────────── KEY DEVELOPMENT PRODUCTION ────────────────────────────────────────────────────────────────────────── DATABASE_URL postgres://localhost:5432/mydb postgres://prod.db.example.com/mydb API_TOKEN dev-token-abc prod-token-xyz DEBUG_MODE true (missing) STRIPE_KEY (missing) sk_live_xxx ────────────────────────────────────────────────────────────────────────── 0 matching 2 mismatched 2 missing ``` In a real terminal, matching rows are green, mismatched rows are yellow, and missing rows are red. Values are truncated to 36 characters. > [!WARNING] > > The diff output reveals plaintext secret values in your terminal. Run this in a private session and avoid piping output to shared logs. *** ## krypt share Invites a teammate to a project by email. ### Usage ```bash theme={null} krypt share [options] ``` ### Options | Flag | Description | Default | | - | - | - | | `--role` | Permission level: `admin`, `member`, or `viewer` | `member` | ### Examples ```bash theme={null} krypt share my-app bob@company.com ``` ```bash theme={null} krypt share my-app alice@company.com --role admin ``` ```text theme={null} ✓ Invited alice@company.com to "my-app" as admin ``` > [!NOTE] > > The invited user receives an email and must accept before they can access project secrets. Invites expire after 7 days; run the command again to send a new one. On the Free plan a project can have up to 3 people, including the owner, and every teammate is an admin, so use `--role admin`. Pro removes the member limit and adds the `member` and `viewer` roles. See [Roles and permissions](/concepts/roles-and-permissions) for what each role can do. *** ## Configuration The CLI stores its configuration at `~/.krypt/config.json` with `0600` permissions (readable only by your user). To point the CLI at a custom API endpoint, set the `KRYPT_API_URL` environment variable: ```bash theme={null} export KRYPT_API_URL=https://custom.krypthq.com ``` This is useful for testing. ## Exit codes | Code | Meaning | | - | - | | `0` | Command completed successfully | | `1` | Error — authentication failed, project not found, network issue, or invalid input | ## Help Every command supports `--help` for inline usage information: ```bash theme={null} krypt push --help ``` ```bash theme={null} krypt --help ``` # Installation Source: https://docs.krypthq.com/cli/installation Install the Krypt CLI on macOS, Linux, or Windows ## Requirements * [Node.js](https://nodejs.org/) 20 or newer * A free [Krypt account](https://krypthq.com/signup) ## Install with npm ```bash theme={null} npm install -g @kryptorg/cli ``` Verify the install: ```bash theme={null} krypt --version ``` Expected output: ```text theme={null} 2.1.1 ``` ## Permission errors > [!NOTE] > > If you see `EACCES` or "permission denied" errors during install: > > * **macOS / Linux** — prefix the command with `sudo` > * **Windows** — open your terminal as Administrator ```bash theme={null} sudo npm install -g @kryptorg/cli ``` ## Alternative package managers > [tab] yarn > > ```bash theme={null} > yarn global add @kryptorg/cli > ``` > [tab] pnpm > > ```bash theme={null} > pnpm add -g @kryptorg/cli > ``` ## Updating the CLI Install the latest version over the existing one: ```bash theme={null} npm install -g @kryptorg/cli@latest ``` Or pin a specific version: ```bash theme={null} npm install -g @kryptorg/cli@2.1.1 ``` ## Uninstalling ```bash theme={null} npm uninstall -g @kryptorg/cli ``` > [!NOTE] > > This removes the binary but does not delete your stored credentials. To fully remove Krypt from your system: > > ```bash theme={null} > rm -rf ~/.krypt > ``` ## CLI configuration After running `krypt login`, the CLI stores config at `~/.krypt/config.json` with `0600` permissions (owner-only read/write): ```json theme={null} { "apiKey": "krypt_live_...", "apiUrl": "https://api.krypthq.com" } ``` Override the API URL with the `KRYPT_API_URL` environment variable — useful for testing: ```bash theme={null} export KRYPT_API_URL=https://api.example.com krypt whoami ``` In each project directory, `krypt init` creates a `.krypt` file linking that folder to a Krypt project: ```json theme={null} { "project": "my-app", "environment": "development" } ``` ## Troubleshooting **"krypt: command not found"** Your npm global `bin` directory is not in your `PATH`. Run `npm config get prefix` and add `/bin` to your shell profile. See the [npm docs on resolving global install issues](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally). **"Cannot find module" errors** Reinstall with `--force` to rebuild native dependencies: ```bash theme={null} npm install -g @kryptorg/cli --force ``` **Network errors during install** If you're behind a corporate proxy, configure npm to use it: ```bash theme={null} npm config set proxy http://proxy.company.com:8080 npm config set https-proxy http://proxy.company.com:8080 ``` See the [npm proxy configuration docs](https://docs.npmjs.com/cli/v10/using-npm/config#https-proxy). ## Next steps * [Quickstart](/quickstart) — push your first secret in 5 minutes * [CLI commands](/cli/commands) — full reference for every command and flag # Encryption and security Source: https://docs.krypthq.com/concepts/encryption-and-security How Krypt protects your secrets This page summarizes how Krypt encrypts and stores your secrets. For full details on our security practices, infrastructure, and vulnerability disclosure, see [krypthq.com/security](https://www.krypthq.com/security). ## Encryption at rest All secrets are encrypted with **AES-256-GCM** before being stored. Each encryption uses a fresh, random 12-byte nonce (IV) and produces a 16-byte authentication tag. If the stored nonce, tag or ciphertext is altered, decryption fails instead of returning altered plaintext. Stored format: ```text theme={null} v2:base64(nonce + tag + ciphertext) ``` The encryption key never leaves the server and is provided via a server environment variable — it is never exposed to clients or included in API responses. Secrets are decrypted server side by the Krypt API when they are read. This is encryption at rest, not end-to-end encryption. ## Encryption in transit All communication between the CLI, browser, and Krypt API uses **TLS 1.3**. HSTS is enforced on all endpoints, preventing downgrade attacks. ## API key security API keys are **SHA-256 hashed** before being stored in the database. The plaintext key is shown only once at creation and is never persisted server-side. If you lose a key, generate a new one — there is no way to recover the original. ## CLI config security The CLI stores your API key locally at `~/.krypt/config.json` with **0600 permissions** (owner read/write only). Other users on the same system cannot read your credentials. ## Audit log Every change to a secret or to team access is recorded with who did it and when. So is every read of secret values: `krypt pull`, `krypt run`, `krypt diff`, a dashboard view, a version history view, and any API key request that returns values. A read entry records the person, the project, the environment, how many values were returned, and whether it came from the dashboard, the CLI or an API key. It never records the values themselves. Repeated reads of the same environment by the same person within ten minutes are logged once. Entries are deleted 90 days after they are created, on every plan. Within those 90 days the dashboard shows the last 7 days on Free and the full 90 on Pro. ## Your data From your account settings you can download a JSON export of everything Krypt stores about your account, including your full audit log with no date window. Secret values are not included, in plaintext or encrypted form, and neither are API key hashes or webhook signing secrets. Use `krypt pull` or the dashboard to retrieve values. Deleting your account is immediate and cannot be undone. The full list of what is removed and what remains is in the [Privacy Policy](https://www.krypthq.com/privacy). ## Sub-processors Krypt uses the following third-party services to operate: | Service | Purpose | Region | | - | - | - | | Clerk | Authentication | US | | Supabase | Database | eu-west-1 (Ireland) | | Stripe | Payments | TBD (not yet configured) | | Resend | Transactional email | eu-west-1 | | Railway | Backend hosting | europe-west4 (Amsterdam) | | Vercel | Frontend hosting | Global edge network | | Sentry | Error tracking | EU (Frankfurt) | | Umami | Cookieless visit counts, public marketing pages only | Analytics data in the EU | For full sub-processor agreements and EU-US data transfer details, see [our security page](https://www.krypthq.com/security). > [!NOTE] > > Clerk processes authentication data in the United States under the EU-US Data Privacy Framework adequacy decision (July 2023). Umami is based in the United States, and its delivery, security and logging services may run outside the EU. All other sub-processors operate within the EU or on global edge networks. ## More information For our full security whitepaper, responsible disclosure policy, and SOC 2 status, visit [krypthq.com/security](https://www.krypthq.com/security). # Projects and environments Source: https://docs.krypthq.com/concepts/projects-and-environments How Krypt organizes your secrets Krypt organizes secrets into **projects**, each with three fixed **environments**. This page explains how they work together. ## Projects A project in Krypt represents one application or service — your frontend app, your API server, your mobile backend, etc. Each project has: * Its own set of secrets (environment variables) * Its own team members and permissions * Three separate environments Create projects from the [Krypt dashboard](https://krypthq.com/dashboard) or list your existing ones with: ```bash theme={null} krypt list ``` ## Environments Every project has three fixed environments: | Environment | Purpose | Example `DATABASE_URL` | | - | - | - | | `development` | Local dev work | `postgres://localhost:5432/myapp_dev` | | `staging` | Pre-production testing | `postgres://staging-db.internal:5432/myapp` | | `production` | Live application | `postgres://prod-db.internal:5432/myapp` | The same secret keys exist across environments but hold different values. This mirrors how most teams deploy — the same app runs in multiple places with different configuration. ## The .krypt file When you run `krypt init`, it creates a `.krypt` file in your project directory: ```json theme={null} { "project": "my-app", "environment": "development" } ``` This tells the CLI which project and default environment to use when you run `krypt push`, `krypt pull`, or `krypt run` from that directory. > [!NOTE] > > Add `.krypt` to your `.gitignore`. It contains your local binding and should not be committed. ## Switching environments Override the default environment with the `--env` flag on any command: ```bash theme={null} krypt pull --env staging ``` ```bash theme={null} krypt push --env production ``` ```bash theme={null} krypt run --env staging -- npm test ``` ```bash theme={null} krypt diff --envA development --envB production ``` The `--env` flag is temporary — it doesn't change your `.krypt` file. Your default remains whatever you set with `krypt init`. ## Why three fixed environments? We considered supporting custom environment names but kept it to three. Most teams follow the development → staging → production flow, and three covers that without adding configuration complexity. If you need a separate environment for a feature branch, use a separate project (e.g. `my-app-feature-x`). ## Next steps * [Roles and permissions](/concepts/roles-and-permissions) — control who can access and edit each environment # Roles and permissions Source: https://docs.krypthq.com/concepts/roles-and-permissions How team access works in Krypt Every member of a Krypt project has one of four roles. Roles control what a person can read, write, and manage. ## Roles overview | Role | Read all envs | Write dev/staging | Write production | Manage members | | - | :-: | :-: | :-: | :-: | | **Owner** | ✓ | ✓ | ✓ direct | ✓ | | **Admin** | ✓ | ✓ | ✓ direct | ✓ | | **Member** | ✓ | ✓ | Via change request | ✗ | | **Viewer** | ✓ | ✗ | ✗ | ✗ | ## Owner The person who created the project. Owners have full access and cannot be removed from the project. Ownership can be transferred to another member from the dashboard. ## Admin Full access to secrets across all environments. Admins can invite and remove members, approve change requests, and push directly to production. The only thing an admin cannot do is remove the owner. Good for: senior engineers, team leads, DevOps. ## Member The standard team role. Members can read secrets in all environments and push directly to development and staging. To change production secrets, members must submit a **change request** for owner/admin approval. Good for: most engineers on the team. ## Viewer Read-only access to all environments. Viewers cannot push, pull, or edit secrets. They can view values in the dashboard. Good for: stakeholders, PMs, or auditors who need visibility without write access. ## Change requests Change requests are Krypt's production safety mechanism. When a member tries to edit a production secret, Krypt blocks the direct write and creates a change request instead. **1. Member proposes a change** The member edits a production secret in the dashboard or runs `krypt push --env production`. Instead of applying immediately, Krypt creates a pending change request. **2. Owner or admin reviews** Pending requests appear in the project dashboard. The reviewer sees the proposed key/value changes and can approve or reject. **3. Change is applied or rejected** Approved changes are applied to production immediately. The requester receives an email notification. Rejected changes are preserved with the rejection reason for context. > [!NOTE] > > Change requests apply only to production. Members edit development and staging directly without approval. ## Inviting members **From the dashboard:** Project → Members → Invite. Enter the email and select a role. **From the CLI:** ```bash theme={null} krypt share my-app bob@company.com --role member ``` ```bash theme={null} krypt share my-app alice@company.com --role admin ``` The invitee receives an email, clicks the link, and accepts the invite. They must already have a Krypt account or sign up to accept. Invites expire after 7 days. If one expires, send it again from the same place. > [!NOTE] > > Owners and admins can invite teammates on every plan. The limits follow the project owner's plan. On the **Free plan** a project can have up to 3 people, including the owner, and pending invites count toward that limit until they expire. Every teammate on a Free project is an admin. The **Pro plan** removes the member limit and adds the member and viewer roles and change requests. ## Next steps * [Encryption and security](/concepts/encryption-and-security) — how Krypt protects your secrets * [Quickstart](/quickstart) — get started with the CLI # Webhooks Source: https://docs.krypthq.com/concepts/webhooks Get notified when a secret changes Webhooks tell your systems that a secret changed. When someone creates, updates, or deletes a secret in a project, Krypt sends a signed HTTP POST to the URL you registered — so you can redeploy a service, invalidate a cache, or post to a team channel. > [!NOTE] > > **Webhook payloads contain metadata only — never secret values.** A delivery tells you *which key* changed, in *which environment*, and *when*. It never includes the value of the secret, before or after the change. To read a value, use `krypt pull` or the dashboard. ## Creating a webhook Webhooks are configured per project, and only owners and admins can manage them. **1. Open the Webhooks tab** In your [Krypt dashboard](https://krypthq.com/dashboard), open a project and select the **Webhooks** tab. **2. Add the endpoint** Enter a **name** (3–50 characters) and the **URL** that will receive deliveries. The URL must use `https://`. Private, loopback, and internal addresses are rejected — both when you save the webhook and again on every delivery. **3. Choose environment and events** Scope the webhook to `development`, `staging`, `production`, or all environments, then pick which of the three events it should receive. **4. Save the signing secret** On save, Krypt shows a **signing secret** — a 64-character hex string used to sign every delivery. It is shown **once** and cannot be recovered. Copy it and store it with your other secrets before closing the dialog. > [!WARNING] > > If you lose the signing secret, you cannot retrieve it. Rotate it from the webhook's menu to generate a new one — the old secret stops working immediately, so update your receiver before rotating. ## Events Three events exist: | Event | Fired when | | - | - | | `secret.created` | A new secret is added to an environment | | `secret.updated` | An existing secret's value is changed, or a secret is restored to an earlier version | | `secret.deleted` | A secret is removed from an environment | A delivery is sent only when **both** conditions hold: the event is in the webhook's subscribed list, and the webhook's environment is `all` or matches the environment of the changed secret. > [!NOTE] > > Restoring a secret to a previous version fires `secret.updated`, the same as an ordinary edit. The payload does not distinguish the two. ## Payload Every secret event sends this JSON body: ```json theme={null} { "event": "secret.updated", "key": "DATABASE_URL", "environment": "production", "project_id": "3f9a1c62-5d84-4b7e-9c21-0e5a7d3f1b88", "timestamp": "2026-08-07T09:14:22.331Z" } ``` | Field | Type | Description | | - | - | - | | `event` | string | `secret.created`, `secret.updated`, or `secret.deleted` | | `key` | string | The name of the secret that changed — not its value | | `environment` | string | `development`, `staging`, or `production` | | `project_id` | string | UUID of the project | | `timestamp` | string | ISO 8601 timestamp of the delivery | These five fields are the entire payload. In particular, it does **not** identify who made the change — to see the actor, check the project's activity log in the dashboard. Two headers accompany every delivery: | Header | Value | | - | - | | `X-Krypt-Signature` | `sha256=` — see [Verifying signatures](#verifying-signatures) | | `X-Krypt-Event` | The event name, so you can route without parsing the body | ## Test ping The **Test** action on a webhook sends a ping so you can confirm your endpoint is reachable. The test payload has a **different shape** to a real event: ```json theme={null} { "event": "test.ping", "project_id": "3f9a1c62-5d84-4b7e-9c21-0e5a7d3f1b88", "test": true, "message": "This is a test ping from Krypt", "timestamp": "2026-08-07T09:14:22.331Z" } ``` Differences from a secret event: * There is **no `key` and no `environment`** field. A receiver that assumes those are always present will break on a test ping. * It carries `test: true` and a human-readable `message`. * It ignores the webhook's event and environment filters — a test ping is delivered even if the webhook only subscribes to `secret.deleted` in `production`. The ping is signed exactly like a real delivery, with `X-Krypt-Event: test.ping`. The webhook must be active — testing a disabled webhook returns an error instead of sending. > [!TIP] > > Handle `test.ping` explicitly in your receiver and return `200` — that way the dashboard reports a successful test, and your event-handling logic never sees a payload without a `key`. ## Verifying signatures Every delivery is signed with **HMAC-SHA256** using your webhook's signing secret. The digest is computed over the **raw request body** and sent as: ```text theme={null} X-Krypt-Signature: sha256= ``` > [!WARNING] > > Verify against the **raw bytes** of the request body, exactly as received. If you parse the JSON and re-serialise it, key order and whitespace can differ from what Krypt signed, and the signature will not match. In Express this means using `express.raw()` on the webhook route — not `express.json()`. A complete Node.js + Express receiver: ```js theme={null} import express from "express"; import crypto from "node:crypto"; const app = express(); const SIGNING_SECRET = process.env.KRYPT_SIGNING_SECRET; app.post( "/krypt-webhook", // express.raw() keeps req.body as a Buffer — the exact bytes Krypt signed. express.raw({ type: "application/json" }), (req, res) => { const received = req.get("X-Krypt-Signature") ?? ""; const expected = "sha256=" + crypto .createHmac("sha256", SIGNING_SECRET) .update(req.body) .digest("hex"); // Constant-time compare. timingSafeEqual throws on length mismatch, // so check length first. const a = Buffer.from(received); const b = Buffer.from(expected); if (a.length !== b.length || !crypto.timingSafeEqual(a, b)) { return res.status(401).send("Invalid signature"); } const payload = JSON.parse(req.body.toString("utf8")); if (payload.event === "test.ping") { return res.status(200).send("ok"); } console.log(`${payload.event}: ${payload.key} in ${payload.environment}`); // Respond 2xx quickly — Krypt times out after 10 seconds. res.status(200).send("ok"); } ); app.listen(3000); ``` Reject any request whose signature does not match. An unverified request proves nothing about its origin. ## Endpoint authentication If your receiver needs its own credentials on top of the signature, set an auth type when creating the webhook. Krypt then adds an `Authorization` header to every delivery: | Auth type | Header sent | | - | - | | `none` | No `Authorization` header (default) | | `bearer` | `Authorization: Bearer ` | | `basic` | `Authorization: Basic ` | Basic credentials are entered as `username:password`. Stored credentials are encrypted at rest and never returned in full by the API — reads show a masked value only. This is optional and independent of signing. The signature is always sent; endpoint auth is for receivers that additionally gate on a token. ## Limitations Current behaviour, stated plainly so you can design your receiver around it: > [!WARNING] > > * **One delivery attempt, no retries.** Krypt sends each event once, with a 10-second timeout. If your endpoint is down, returns a non-2xx status, or times out, the event is **not retried and is lost**. The failure is recorded in the project's activity log and as the webhook's last status, but it is never resent. > * **No delivery ID.** Payloads carry no unique event identifier, so there is nothing to deduplicate on if you receive the same event twice. > * **No replay protection.** There is no timestamp header and no expiry on a signature. A captured delivery remains valid indefinitely if replayed against your endpoint. The `timestamp` inside the body is signed — you can reject old payloads yourself by comparing it against the current time. > * **No actor.** The payload does not say who made the change. Because nothing is retried, your only record of a delivery is the dashboard: each webhook in the project's **Webhooks** tab shows when it last fired and the HTTP status it returned, and the project's activity log lists every individual success and failure. Additional constraints worth knowing: * Only `https://` URLs are accepted; private, loopback, and internal addresses are blocked, and the URL is re-validated on every delivery. * Only owners and admins can create, edit, test, or delete webhooks. * On a Free project that is over the team-member cap, the project becomes read-only and webhooks stop firing entirely — including test pings. ## Next steps * [Roles and permissions](/concepts/roles-and-permissions) — who can manage webhooks * [Encryption and security](/concepts/encryption-and-security) — how Krypt protects stored secrets * [CLI commands](/cli/commands) — push and pull the secrets these events describe # Troubleshooting Source: https://docs.krypthq.com/help/troubleshooting Common errors and how to fix them Solutions to the most common issues with the Krypt CLI. If your problem isn't listed here, email [hello@krypthq.com](mailto:hello@krypthq.com). ### "krypt: command not found" after install **Cause:** npm's global `bin` directory is not in your shell's `PATH`. **Fix:** Find npm's prefix and add it to your PATH: ```bash theme={null} npm config get prefix ``` Add `/bin` to your shell profile (`~/.zshrc`, `~/.bashrc`, or equivalent): ```bash theme={null} export PATH="$(npm config get prefix)/bin:$PATH" ``` Restart your terminal or run `source ~/.zshrc`. ### "EACCES: permission denied" on install **Cause:** npm is trying to write to a system-owned directory. **Fix:** Either install with `sudo`: ```bash theme={null} sudo npm install -g @kryptorg/cli ``` Or configure npm to use a user-owned directory for global installs. See the [npm docs on fixing permissions](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally). ### "Not authenticated" when running commands **Cause:** Your API key is invalid, expired, or was revoked. **Fix:** Log in again with a valid key: ```bash theme={null} krypt login --key krypt_live_ ``` If your key was revoked, generate a new one at [krypthq.com/dashboard/api-keys](https://krypthq.com/dashboard/api-keys). ### "Project 'X' not found" **Cause:** The project doesn't exist on Krypt, or your account doesn't have access to it. **Fix:** Check which projects you can access: ```bash theme={null} krypt list ``` If the project isn't listed, create it in the [dashboard](https://krypthq.com/dashboard) or ask the project owner to invite you. ### "Members cannot directly edit production secrets" **Cause:** Your role is Member and you're trying to push to production. **Fix:** Members must submit a change request for production edits. Use the dashboard to propose the change, then ask an Owner or Admin on your team to approve it. > [!TIP] > > If you need direct production access, ask the project owner to upgrade your role to Admin. ### "Failed to fetch" / network errors **Cause:** The Krypt API is unreachable — firewall, DNS, or proxy issue. **Fix:** Verify the API is up: ```bash theme={null} curl https://api.krypthq.com/api/health ``` If that returns a non-200 response, check [Krypt's status page](https://krypthq.com) for outages. If you're behind a corporate proxy, configure your terminal environment: ```bash theme={null} export HTTPS_PROXY=http://proxy.company.com:8080 ``` ### Secrets pulled but .env shows old values **Cause:** You pulled from the wrong environment, or secrets were updated after your last pull. **Fix:** Pull from the correct environment explicitly: ```bash theme={null} krypt pull --env staging ``` Use `krypt diff` to compare what's different between environments: ```bash theme={null} krypt diff --envA development --envB staging ``` ### Still stuck? Email **[hello@krypthq.com](mailto:hello@krypthq.com)** with: 1. Your CLI version (`krypt --version`) 2. The full command you ran 3. The complete error output # Quickstart Source: https://docs.krypthq.com/quickstart Get started with Krypt in under 5 minutes Krypt manages your environment variables across teams with AES-256 encryption at rest. By the end of this guide you'll have the CLI installed, a project linked, and your first secrets pushed. > [!NOTE] > > You need a free [Krypt account](https://krypthq.com/signup) and Node.js 20 or newer to follow along. **1. Install the CLI** > [tab] npm > > ```bash theme={null} > npm install -g @kryptorg/cli > ``` > [tab] yarn > > ```bash theme={null} > yarn global add @kryptorg/cli > ``` > [tab] pnpm > > ```bash theme={null} > pnpm add -g @kryptorg/cli > ``` > [!TIP] > > Getting a permission error? Run the command with `sudo` (macOS/Linux) or open your terminal as Administrator (Windows). > > ```bash theme={null} > sudo npm install -g @kryptorg/cli > ``` Verify the install: ```bash theme={null} krypt --version ``` Expected output: ```text theme={null} 2.1.1 ``` **2. Generate an API key** 1. Open the [API keys page](https://krypthq.com/dashboard/api-keys) in your Krypt dashboard 2. Click **Generate Key** 3. Name it after where you'll use it — e.g. "my-laptop", "production-ci", "teammate-bob" 4. Copy the key — it starts with `krypt_live_` and is shown only once **3. Log in from your terminal** ```bash theme={null} krypt login --key krypt_live_ ``` You should see: ```text theme={null} ✓ API key verified Config saved to ~/.krypt/config.json ``` **4. Create a project** In your [Krypt dashboard](https://krypthq.com/dashboard): 1. Click **New Project** 2. Name it `my-app` 3. Save **5. Link your local folder** Inside your project directory, run: ```bash theme={null} krypt init my-app ``` This creates a `.krypt` config file that links the folder to your Krypt project. **6. Push your first secrets** If you already have a `.env` file, push it directly: ```bash theme={null} krypt push ``` Or create one first: ```bash theme={null} echo "DATABASE_URL=postgres://localhost:5432/mydb" > .env echo "API_TOKEN=secret-value" >> .env krypt push ``` You should see: ```text theme={null} ✓ Pushed 2 secret(s) to "my-app" (development) ``` Your secrets are now encrypted and stored in Krypt. **7. Pull secrets on another machine** If you're working on multiple machines or setting up CI/CD, run `krypt pull` to fetch the latest secrets: ```bash theme={null} krypt pull ``` Krypt fetches your secrets and writes them to `.env`. **8. Run a command with injected secrets** Instead of writing a `.env` file, inject secrets directly into a process: ```bash theme={null} krypt run -- node server.js ``` Krypt loads your secrets as environment variables and starts the command. No `.env` file needed. ## What's next Got Krypt running? Next, learn about the [CLI commands](/cli/commands), how to [organize secrets across environments](/concepts/projects-and-environments), or [share projects with your team](/concepts/roles-and-permissions). These pages are being expanded — contact [hello@krypthq.com](mailto:hello@krypthq.com) if you need help in the meantime. # What is Krypt Source: https://docs.krypthq.com/what-is-krypt Secrets management for developers Krypt is a secrets management platform that lets development teams store, share, and deploy environment variables with AES-256 encryption at rest. It replaces the fragile practice of passing `.env` files through Slack, email, or git — giving every team member access to the right secrets for the right environment. ## The problem Most teams manage secrets by copy-pasting `.env` files between developers. This creates real risks: * **Secrets sprawl** — copies of production credentials live in Slack DMs, emails, local machines, and cloud drives with no central inventory * **No audit trail** — when a secret leaks, there's no way to know who had access or when it was last changed * **Accidental commits** — `.env` files get pushed to git, exposing credentials in version history permanently * **Onboarding friction** — new team members wait hours or days for someone to send them the right env vars * **Environment drift** — local, staging, and production configs diverge silently until something breaks ## The solution Krypt provides three things: 1. **Encrypted central store** — secrets are sent over TLS, stored centrally with AES-256 encryption at rest, and decrypted only when pulled or injected 2. **CLI for daily workflow** — `krypt push`, `krypt pull`, and `krypt run` fit into your existing terminal workflow without changing how you develop 3. **Dashboard for team management** — invite members, assign roles, review change requests for production, and see an audit log of changes to secrets and team access, and of who pulled or read secret values ## Key features * AES-256 encryption at rest for all secrets * Three environments per project: development, staging, production * Role-based access control (Owner, Admin, Member, Viewer) * Change requests for production safety — members propose, admins approve * Audit log of push, pull, share and edit actions, kept for 90 days * CLI-first workflow with `@kryptorg/cli` * Web dashboard for team management and visibility ## How it compares Krypt is similar in concept to Doppler and Infisical — a centralized secrets manager with a CLI. The difference is scope: Krypt is built to be simpler and more affordable for small teams and solo developers. No Kubernetes operators, no infrastructure agents, no enterprise sales calls. Install the CLI, push your `.env`, invite your team. ## Next steps * [Quickstart](/quickstart) — get running in 5 minutes