hasAllEnvVars

View as MarkdownOpen in Claude

Convenience wrapper around validateEnvVars() that returns a boolean. Mirrors the Python SDK’s validate_env_vars() -> bool return shape. Checks each entry in the skill class’s REQUIRED_ENV_VARS static array against process.env.

Returns

booleantrue if every required env var is present, false otherwise.

Example

import { SkillBase } from '@signalwire/sdk';
export class WeatherSkill extends SkillBase {
static SKILL_NAME = 'weather';
static SKILL_DESCRIPTION = 'Fetches current weather.';
static REQUIRED_ENV_VARS = ['WEATHER_API_KEY'];
async setup(): Promise<boolean> {
if (!this.hasAllEnvVars()) {
this.logger.error('Missing required environment variables');
return false;
}
return true;
}
}