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

1import { SkillBase } from '@signalwire/sdk';
2
3export class WeatherSkill extends SkillBase {
4 static SKILL_NAME = 'weather';
5 static SKILL_DESCRIPTION = 'Fetches current weather.';
6 static REQUIRED_ENV_VARS = ['WEATHER_API_KEY'];
7
8 async setup(): Promise<boolean> {
9 if (!this.hasAllEnvVars()) {
10 this.logger.error('Missing required environment variables');
11 return false;
12 }
13 return true;
14 }
15}