Skip to content

Function: getSkillIcon()

ts
function getSkillIcon(ctx: Context): Promise<string | undefined>;

Defined in: src/utils/getSkillIcon.ts:42

Get the skill icon as a base64 data URI string.

For managed skills, read from {assistantPath}/skills/managed/index.json and return the iconPictureUrl for the matching skill identifier.

For local skills, extract icon.png from the skill zip file at {assistantPath}/skills/local/{skillName}.zip.

Parameters

ParameterTypeDescription
ctxContextThe skill context.

Returns

Promise<string | undefined>

A data URI string, or undefined if not found.

Examples

ts
const icon = await getSkillIcon(ctx);
await showUI(ctx, bubble([
  headerBar({
    title: 'My Skill',
    icon: icon,
  }),
  group([...]),
]));
ts
const icon = await getSkillIcon(ctx);
await showUI(ctx, bubble([
  headerBar({
    title: 'My Skill',
    icon: icon || 'fallback-icon',
  }),
  group([...]),
]));

Matterway Assistant SDK Documentation