Profile Switcher
Switch between different profiles to manage multiple tenants.
import { getProfileManager, CredentialManager, createHttpClient } from '@robinmordasiewicz/f5xc-auth';
async function switchAndTest(profileName: string) { const profileManager = getProfileManager();
// Switch profile await profileManager.setActive(profileName); console.log(`Switched to: ${profileName}`);
// Initialize with new profile const credentialManager = new CredentialManager(); await credentialManager.initialize();
// Test connection const httpClient = createHttpClient(credentialManager); if (httpClient.isAvailable()) { const response = await httpClient.get('/web/namespaces'); console.log(`Connected to: ${credentialManager.getTenant()}`); console.log(`Namespaces: ${response.data.items.length}`); }}
// UsageswitchAndTest('production').catch(console.error);See Also
Section titled “See Also”- Profile Management Guide - Profile operations
- ProfileManager API - API documentation
- Authentication - Configure profiles