Member Junction
    Preparing search index...

    Interface APIKeyGenerationConfig

    Configuration for API key generation parameters.

    WARNING: Changing these values after API keys have been created will invalidate all existing keys. They will fail format validation and/or hash comparison. Only change these before issuing any keys, or be prepared to rotate all keys.

    All properties are optional — omitted values use the defaults shown below.

    interface APIKeyGenerationConfig {
        encoding?: APIKeyEncoding;
        entropyBytes?: number;
        hashAlgorithm?: string;
        prefix?: string;
    }
    Index

    Properties

    encoding?: APIKeyEncoding

    Encoding format for the random portion of the key body. Does NOT affect the hash stored in the database (always hex).

    'hex'
    
    entropyBytes?: number

    Number of cryptographically secure random bytes used for key entropy. The resulting encoded string length depends on the encoding:

    • hex: entropyBytes * 2 characters
    • base64url: Math.ceil(entropyBytes * 4/3) characters
    32
    
    hashAlgorithm?: string

    Hash algorithm used for key storage and comparison. Must be a valid Node.js crypto.createHash() algorithm name (e.g., 'sha256', 'sha512', 'sha384'). The hash is always output as a hex string regardless of the key encoding.

    'sha256'
    
    prefix?: string

    Prefix prepended to generated API keys (e.g., 'mj_sk_', 'skip-'). Used for key format detection and identification.

    'mj_sk_'