Member Junction
    Preparing search index...
    • Resolves a single credential value by checking the request value first, then falling back to the environment value if allowed.

      Type Parameters

      • T

      Parameters

      • requestValue: T

        Value provided in the request (takes precedence)

      • envValue: T

        Value from environment variable (fallback)

      • disableFallback: boolean

        If true, don't use the environment value

      Returns T

      The resolved value, or undefined if not available

      const apiKey = resolveCredentialValue(
      credentials?.apiKey, // From request
      process.env.SENDGRID_API_KEY, // From environment
      credentials?.disableEnvironmentFallback ?? false
      );