Skip to content

Function: setThemeInLocalstorage()

ts
function setThemeInLocalstorage(ctx: Context, theme: {
  assistantColor: string;
  assistantSecondaryColor: string | null;
}): Promise<void>;

Defined in: src/themes/themesConfig.ts:18

Store the theme colors in localStorage and dispatch a theme-initialized event.

Parameters

ParameterTypeDescription
ctxContextThe assistant context with page access.
theme{ assistantColor: string; assistantSecondaryColor: string | null; }The color values to persist.
theme.assistantColorstring-
theme.assistantSecondaryColorstring | null-

Returns

Promise<void>

Example

ts
await setThemeInLocalstorage(ctx, {
  assistantColor: '#7B2EFF',
  assistantSecondaryColor: '#00C9A7',
});

Matterway Assistant SDK Documentation