Resolves a single credential value by checking the request value first, then falling back to the environment value if allowed.
Value provided in the request (takes precedence)
Value from environment variable (fallback)
If true, don't use the environment value
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); Copy
const apiKey = resolveCredentialValue( credentials?.apiKey, // From request process.env.SENDGRID_API_KEY, // From environment credentials?.disableEnvironmentFallback ?? false);
Resolves a single credential value by checking the request value first, then falling back to the environment value if allowed.