Skip to content

Quick Start

Get started with f5xc-auth in minutes.

The simplest way to get started is with the CredentialManager:

import { CredentialManager } from '@robinmordasiewicz/f5xc-auth';
// Initialize credential manager
const credentialManager = new CredentialManager();
await credentialManager.initialize();
// Check authentication status
if (credentialManager.isAuthenticated()) {
console.log(`Authenticated as: ${credentialManager.getTenant()}`);
console.log(`API URL: ${credentialManager.getApiUrl()}`);
console.log(`Namespace: ${credentialManager.getNamespace()}`);
} else {
console.error('Not authenticated. Please configure credentials.');
}

Use the createHttpClient function to get a pre-configured Axios instance:

import { CredentialManager, createHttpClient } from '@robinmordasiewicz/f5xc-auth';
const credentialManager = new CredentialManager();
await credentialManager.initialize();
const httpClient = createHttpClient(credentialManager, {
timeout: 30000,
debug: true // Enable request/response logging
});
if (httpClient.isAvailable()) {
// List all namespaces
const response = await httpClient.get('/web/namespaces');
console.log('Namespaces:', response.data);
// Get specific namespace details
const nsResponse = await httpClient.get('/web/namespaces/my-namespace');
console.log('Namespace details:', nsResponse.data);
}