A comprehensive TypeScript client library for interacting with Keycloak's Administration API.
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
Server information provides access to Keycloak server metadata, configuration details, and message bundles for internationalization. This includes server version, provider information, theme details, and locale-specific resources.
Retrieve comprehensive server information and configuration details.
/**
* Get server information including version, providers, and configuration
* @returns Server information representation with all server details
*/
find(): Promise<ServerInfoRepresentation>;Access internationalization message bundles for themes and locales.
/**
* Find effective message bundles for themes and locales
* @param query - Parameters for message bundle lookup
* @returns Array of effective message bundle representations
*/
findEffectiveMessageBundles(query: MessageBundleQuery): Promise<EffectiveMessageBundleRepresentation[]>;import KeycloakAdminClient from "@keycloak/keycloak-admin-client";
const kcAdminClient = new KeycloakAdminClient({
baseUrl: 'http://localhost:8080',
realmName: 'master',
});
await kcAdminClient.auth({
username: 'admin',
password: 'admin',
grantType: 'password',
clientId: 'admin-cli',
});
// Get server information
const serverInfo = await kcAdminClient.serverInfo.find();
console.log('Keycloak Version:', serverInfo.systemInfo?.version);
console.log('Available Providers:', Object.keys(serverInfo.providers || {}));
// Get message bundles for a specific theme and locale
const messageBundles = await kcAdminClient.serverInfo.findEffectiveMessageBundles({
realm: 'myrealm',
themeType: 'login',
locale: 'en',
theme: 'keycloak',
source: false
});
console.log('Available messages:', messageBundles[0]?.messages);interface MessageBundleQuery {
realm: string;
theme?: string;
themeType?: string;
locale?: string;
source?: boolean;
}
interface ServerInfoRepresentation {
systemInfo?: {
version?: string;
serverTime?: string;
uptime?: string;
uptimeMillis?: number;
javaVersion?: string;
javaVendor?: string;
javaVm?: string;
javaVmVersion?: string;
javaRuntime?: string;
javaHome?: string;
osName?: string;
osArchitecture?: string;
osVersion?: string;
fileEncoding?: string;
userName?: string;
userDir?: string;
userTimezone?: string;
userLocale?: string;
};
memoryInfo?: {
total?: number;
totalFormated?: string;
used?: number;
usedFormated?: string;
free?: number;
freePercentage?: number;
freeFormated?: string;
};
profileInfo?: {
name?: string;
disabledFeatures?: string[];
previewFeatures?: string[];
experimentalFeatures?: string[];
};
themes?: Record<string, string[]>;
socialProviders?: string[];
identityProviders?: string[];
providers?: Record<string, {
internal?: string[];
providers?: Record<string, {
order?: number;
}>;
}>;
protocolMapperTypes?: Record<string, Record<string, ProtocolMapperTypeRepresentation>>;
builtinProtocolMappers?: Record<string, ProtocolMapperRepresentation[]>;
clientInstallations?: Record<string, string>;
enums?: Record<string, string[]>;
}
interface EffectiveMessageBundleRepresentation {
messages?: Record<string, string>;
}
interface ProtocolMapperTypeRepresentation {
id?: string;
name?: string;
category?: string;
helpText?: string;
priority?: number;
properties?: ConfigPropertyRepresentation[];
}docs