Keyshade Documentation

repository·develop·Indexed 20 days ago

https://github.com/keyshade-xyz/keyshade

A secure secret management platform using Public Key Encryption to protect sensitive configurations. Keyshade provides end-to-end encryption, live secret updates without application restarts, and secret sprawl detection. It includes a CLI for managing secrets across environments and offers integration guides for Next.js, Node.js, Go, Rust, Python, AWS Lambda, Vercel, Slack, and Discord.

Tokens
133.7K
Snippets
545
Records
699
Agent score
72%

What's inside Keyshade

  1. Overview of Keyshade

    develop

    Keyshade is a secret and configuration management tool designed for developers, teams, and infrastructure. It provides a secure way to manage environment variables across local development environments, CI/CD pipelines, and production systems.

    Key capabilities include:

    • Environment Synchronization: Sync secrets across different environments with single commands to avoid scattered .env files.
    • Leak Prevention: Scans codebases for exposed credentials to prevent accidental commits of sensitive tokens.
    • Auditability: Maintains a history of secret changes, allowing for tracking, auditing, and rollbacks.
    • Granular Access Control: Manages permissions per project and per environment.
    • Runtime Updates: Allows updating secrets without requiring application restarts by pulling fresh values at runtime.
    • End-to-End Encryption: Secrets are encrypted end-to-end and only decrypted on the user's local machine, ensuring the service provider cannot access them.
  2. Overview of Keyshade CLI features

    develop

    The Keyshade CLI is designed for secret management and configuration. Key capabilities include:

    • Secret Sprawl Detection: Identify and prevent sensitive data leaks.
    • Live Secret Update: Instantly propagate secret changes across applications without requiring a redeployment.
    • Secrets Management: Securely store, retrieve, and rotate secrets.
    • Full Platform Parity: The CLI provides access to almost all features available on the Keyshade web platform.
  3. Understand the Keyshade project structure

    develop

    The Keyshade codebase is organized into two main directories: apps and packages. This modular structure separates deployable applications from shared configuration and logic.

    apps directory

    Contains standalone applications, each with its own package.json:

    • api: The primary REST API server.
    • web: The web application serving the project homepage.
    • cli: The command-line interface for interacting with the API and receiving live updates.
    • platform: The main user interface application where core work is performed.

    packages directory

    Contains shared modules used across multiple applications:

    • eslint-config-custom: Custom ESLint configurations.
    • tsconfig: Custom TypeScript configurations.

    A root-level package.json manages shared dependencies and provides scripts to run both applications and shared packages.

  4. The Web package technology stack

    develop

    The Keyshade web application is built using a modern frontend stack designed for performance, styling, and interactivity. Developers working on or extending the web application should be familiar with these technologies:

    • Framework: Next.js
    • Frontend Library: React
    • Content: MDX (for Markdown and JSX integration)
    • Styling: Tailwind CSS
    • Animations: Framer Motion and @tsparticles (engine, react, and slim) for particle effects
    • UI Components: Geist
    • Notifications: Sonner
    • Language: TypeScript
  5. Navigate the API module structure

    develop

    The API is organized into modules following NestJS conventions. When exploring or extending a module, you will encounter the following directory structure:

    • controller: Contains the API endpoints that clients interact with.
    • service: Contains the core business logic.
    • misc: Contains utility functions and classes specific to that module.
    • dto: Contains Data Transfer Objects (DTOs) used for validating and shaping data received from clients.
    • types: (Optional) Contains module-specific custom types (e.g., <module_name>.types.ts).
  6. What are Variables in Keyshade?

    develop

    Variables in Keyshade are non-sensitive configuration values used for application settings. Unlike secrets, variables are stored in plaintext and are not encrypted, making them suitable for data that does not require security but needs centralized management.

    Key Characteristics

    • Plaintext Storage: Optimized for fast access and retrieval.
    • Environment-Specific: You can define different values for the same variable name across different environments (e.g., dev, staging, prod).
    • Versioned: Every update creates a new version, enabling audit trails and rollbacks.
    • Access-Controlled: Permissions can be managed at a fine-grained level.
    • Live Updates: Changes can be propagated to running applications without requiring a restart.
  7. Understand the Keyshade Services and Agreement

    develop

    The Keyshade Services include the website (https://keyshade.io/), related applications, and the keyshade CLI. By using these services, you agree to the Legal Terms, which incorporate the keyshade Documentation and the Privacy Policy.

    Key Requirements:

    • Age: Users must be at least 13 years old. Minors (generally under 18) must have direct supervision and permission from a parent or guardian.
    • Compliance: Use of the services is contingent upon following all terms, guidelines, and policies. If you do not agree, you must discontinue use immediately.
  8. Understand the Web package directory structure

    develop

    The web package follows a standard Next.js structure. When adding new pages, components, or utilities, use the following directory layout:

    • web/public: Static files and assets.
    • web/src/app: Main pages and application settings (App Router).
    • web/src/components: Reusable UI components.
    • web/src/utils: Helper tools and utility functions.
    • web/config_files: Configuration files for the application.
    ├── web
        ├── public
        ├── src
        |      ├── app
        |      ├── components
        |      └── utils
        └── config_files
  9. Best practices for managing secrets

    develop

    To maintain security and compatibility, follow these naming and environment management patterns:

    Naming Conventions

    • Use descriptive, consistent names (e.g., DATABASE_PASSWORD, STRIPE_SECRET_KEY).
    • Use uppercase with underscores to ensure compatibility with standard environment variable formats.
    • Include the service or component name in the secret name.

    Environment Management

    • Use distinct environments for different stages (e.g., dev, staging, prod).
    • Never use production secrets in development environments.
    • Regularly rotate secrets in production environments.
  10. Linking Third-Party Social Media Accounts

    develop

    You can link your Keyshade account to third-party service providers (e.g., social networks) to enable specific functionalities.

    What happens when you link an account:

    • Data Access: Keyshade may access, store, and make available content from your Third-Party Account (the "Social Network Content"), such as friend lists, to make it available through your Keyshade account.
    • Information Exchange: Keyshade may submit and receive additional information from your Third-Party Account as notified.
    • Contact Discovery: Keyshade may access your email address book or mobile device contacts solely to identify and inform you of contacts who have also registered for Keyshade.
    • Disconnection: You can disable the connection between Keyshade and your third-party accounts at any time via account settings or by contacting Keyshade. Upon disconnection, Keyshade will attempt to delete stored third-party information, except for the username and profile picture associated with your account.

    Note: Your relationship with third-party providers is governed by their own terms and conditions, not Keyshade's.

  11. Manage Keyshade CLI profiles

    develop

    The profile command allows you to manage collections of configurations used to interact with the Keyshade API. Profiles store your API keys and base URLs so you can switch between different environments or accounts easily.

    Available subcommands:

    • create: Create a new profile.
    • update: Modify an existing profile.
    • delete: Remove a profile.
    • list: View all available profiles.
    • use: Set a specific profile as the default.
    keyshade profile <subcommand> [options]