Skip to main content

Themes API

Themes API

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

Quick Reference

MethodDescription
createCreates a new custom theme.
deleteDeletes a theme from the system.
getAllRetrieves all available themes in the system.
getByIdRetrieves a specific theme by its unique identifier.
getStatsRetrieves theme statistics and metrics.
resetResets themes to their default configuration.
seedPopularSeeds the system with popular theme presets.
updateUpdates an existing theme's configuration.
updateColorsUpdates the color scheme of a theme.
validateValidates theme data for correctness and completeness.

Methods


create

client.themes.create(data: CreateThemeRequest): Promise<Theme>

Creates a new custom theme.

Registers a new theme with the system using the provided configuration. The theme can be customized with specific colors, fonts, and styling preferences to match design requirements.

ParameterTypeRequiredDescription
dataCreateThemeRequestYesRequest containing the new theme configuration

Returns: Promise<Theme> — A promise that resolves to the created Theme object

Full reference →


delete

client.themes.delete(themeId: string): Promise<unknown>

Deletes a theme from the system.

Permanently removes the specified theme. If the theme is currently active, another theme will need to be set as active. This operation cannot be undone.

ParameterTypeRequiredDescription
themeIdstringYesThe unique identifier of the theme to delete

Returns: Promise<unknown> — A promise that resolves when the theme has been deleted

Full reference →


getAll

client.themes.getAll(): Promise<Theme[]>

Retrieves all available themes in the system.

Returns every theme regardless of whether it's active or inactive. Use this for comprehensive theme browsing or to populate theme selection UIs.

No parameters.

Returns: Promise<Theme[]> — A promise that resolves to an array of Theme objects

Full reference →


getById

client.themes.getById(themeId: string): Promise<Theme>

Retrieves a specific theme by its unique identifier.

Returns detailed information about a single theme including its configuration, colors, settings, and metadata.

ParameterTypeRequiredDescription
themeIdstringYesThe unique identifier of the theme to retrieve

Returns: Promise<Theme> — A promise that resolves to the requested Theme object

Full reference →


getStats

client.themes.getStats(): Promise<ThemeStats>

Retrieves theme statistics and metrics.

Returns aggregated data about themes including counts, usage statistics, and other analytical information useful for monitoring and reporting.

No parameters.

Returns: Promise<ThemeStats> — A promise that resolves to a ThemeStats object containing metrics

Full reference →


reset

client.themes.reset(data?: Record<string, unknown>): Promise<unknown>

Resets themes to their default configuration.

Restores all theme settings to the original system defaults. Optionally accepts custom data to control the reset behavior.

ParameterTypeRequiredDescription
dataRecord<string, unknown>NoOptional parameters for controlling the reset operation

Returns: Promise<unknown> — A promise that resolves when themes have been reset

Full reference →


seedPopular

client.themes.seedPopular(data?: Record<string, unknown>): Promise<unknown>

Seeds the system with popular theme presets.

Creates a collection of well-known and widely-used themes based on popular color schemes and design systems. Useful for initializing the theme catalog with common options.

ParameterTypeRequiredDescription
dataRecord<string, unknown>NoOptional parameters to control the seeding process

Returns: Promise<unknown> — A promise that resolves when popular themes have been seeded

Full reference →


update

client.themes.update(themeId: string, data: UpdateThemeRequest): Promise<Theme>

Updates an existing theme's configuration.

Modifies the properties, colors, or settings of a theme identified by its ID. Use this to make incremental changes to a theme without recreating it from scratch.

ParameterTypeRequiredDescription
themeIdstringYesThe unique identifier of the theme to update
dataUpdateThemeRequestYesRequest containing the theme updates to apply

Returns: Promise<Theme> — A promise that resolves to the updated Theme object

Full reference →


updateColors

client.themes.updateColors(data: UpdateThemeColorsRequest): Promise<unknown>

Updates the color scheme of a theme.

Modifies the color palette for one or more themes. This includes primary colors, background colors, text colors, and other color variables used throughout the interface.

ParameterTypeRequiredDescription
dataUpdateThemeColorsRequestYesRequest containing theme color update information

Returns: Promise<unknown> — A promise that resolves when colors have been updated

Full reference →


validate

client.themes.validate(): Promise<ThemeValidationResult>

Validates theme data for correctness and completeness.

Checks the current theme configuration for errors, inconsistencies, or missing required fields. Returns detailed validation results highlighting any issues found.

No parameters.

Returns: Promise<ThemeValidationResult> — A promise that resolves to a ThemeValidationResult with validation status

Full reference →