Skip to content

ProfileManager

Manage profile storage and retrieval.

import { getProfileManager } from '@robinmordasiewicz/f5xc-auth';
const profileManager = getProfileManager();

List all available profile names.

const profiles = await profileManager.list();
// Returns: ['production', 'staging', 'development']

load(name: string): Promise<Profile | null>

Section titled “load(name: string): Promise<Profile | null>”

Load a specific profile.

const profile = await profileManager.load('production');
if (profile) {
console.log('Loaded profile:', profile.name);
}

Save a new or updated profile.

await profileManager.save({
name: 'production',
apiUrl: 'https://mytenant.console.ves.volterra.io',
apiToken: 'token',
defaultNamespace: 'my-ns'
});

Delete a specific profile.

await profileManager.delete('old-profile');

getActiveProfile(): Promise<Profile | null>

Section titled “getActiveProfile(): Promise<Profile | null>”

Get the currently active profile.

const active = await profileManager.getActiveProfile();
console.log('Active:', active?.name);

Set a profile as active.

await profileManager.setActive('production');

Delete the active profile marker.

await profileManager.deleteActive();

Check if a specific profile is active.

const isActive = await profileManager.isActive('production');