Skip to main content
Glama
auth-helper.ts2.01 kB
import dotenv from 'dotenv'; dotenv.config(); export interface TestCredentials { username: string; password: string; } export function getCredentialsFromEnv(): TestCredentials | null { const username = process.env.UMBRELLA_USERNAME; const password = process.env.UMBRELLA_PASSWORD; if (!username || !password) { console.error('❌ Missing credentials: Please set UMBRELLA_USERNAME and UMBRELLA_PASSWORD environment variables'); console.error(' Example: UMBRELLA_USERNAME=your-email@domain.com UMBRELLA_PASSWORD=your-password'); console.error(' Or create a .env file with these values'); return null; } return { username, password }; } export function getTestCredentialSets(): TestCredentials[] | null { // Check if specific test credentials are provided const mspUsername = process.env.UMBRELLA_TEST_MSP_USERNAME; const mspPassword = process.env.UMBRELLA_TEST_MSP_PASSWORD; const directUsername = process.env.UMBRELLA_TEST_DIRECT_USERNAME; const directPassword = process.env.UMBRELLA_TEST_DIRECT_PASSWORD; const credentials: TestCredentials[] = []; if (mspUsername && mspPassword) { credentials.push({ username: mspUsername, password: mspPassword }); } if (directUsername && directPassword) { credentials.push({ username: directUsername, password: directPassword }); } // If no specific test credentials, use the main credentials if (credentials.length === 0) { const mainCreds = getCredentialsFromEnv(); if (mainCreds) { credentials.push(mainCreds); } } if (credentials.length === 0) { console.error('❌ No test credentials found. Please set environment variables:'); console.error(' - UMBRELLA_USERNAME and UMBRELLA_PASSWORD (for single account)'); console.error(' - OR UMBRELLA_TEST_MSP_USERNAME and UMBRELLA_TEST_MSP_PASSWORD'); console.error(' - AND/OR UMBRELLA_TEST_DIRECT_USERNAME and UMBRELLA_TEST_DIRECT_PASSWORD'); return null; } return credentials; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/daviddraiumbrella/invoice-monitoring'

If you have feedback or need assistance with the MCP directory API, please join our Discord server