CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-keycloak--keycloak-admin-client

A comprehensive TypeScript client library for interacting with Keycloak's Administration API.

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

server-info.mddocs/

Server Info

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.

Capabilities

Server Information

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>;

Message Bundles

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[]>;

Usage Examples

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);

Types

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

attack-detection.md

authentication-management.md

cache-management.md

client-configuration.md

client-management.md

client-policies.md

client-scopes.md

components.md

group-management.md

identity-providers.md

index.md

organization-management.md

realm-management.md

role-management.md

server-info.md

user-management.md

user-storage-provider.md

utility-functions.md

whoami.md

tile.json