HatchedDocs
ReferenceWidgets

Badges widget

A shelf of the buddy's earned badges, with hover details and share actions.

Mount

<div
  data-hatched-widget="badges"
  data-hatched-token="SESSION_OR_EMBED_TOKEN"
  data-hatched-layout="grid"
></div>

Attributes

AttributeValuesDefault
data-hatched-tokensession or embed tokenrequired
data-hatched-layoutgrid row compactgrid
data-hatched-limitnumber12
data-hatched-filterall recent category:<key>all
data-hatched-show-lockedtrue falsetrue

Required scopes

  • buddy:read
  • badges:read

Events

el.addEventListener('hatched:badge-selected', (e) => {
  openBadgeModal(e.detail.badgeId);
});

Share actions

Each badge tile exposes a share button when data-hatched-shareable="true". Share target URLs are resolved via the customer's brand kit (Settings → Sharing) and include OG image metadata.