Shows the "Made with Lynkow" badge, accessible via lynkow.branding.

In a browser, the client mounts the badge at startup when the site config's showBranding is true. Every method is a no-op on the server. The badge follows the page's light or dark theme, and a failed badge request is ignored.

Access via: lynkow.branding

Methods

4 methods

destroy

TypeScript
destroy(): void

Alias for remove, named like the destroy() of the other browser services.

Returns: void

TypeScript
useEffect(() => {
  return () => lynkow.branding.destroy()
}, [])

inject

TypeScript
inject(): Promise<void>

Fetches the badge markup and appends it to document.body, whatever the showBranding setting. Does nothing when a badge is already mounted, and overlapping calls mount one badge. A remove() made while the request is in flight cancels the mount. Never rejects: a failed request leaves the page unchanged.

Returns: Promise<void>

TypeScript
await lynkow.branding.inject()

isVisible

TypeScript
isVisible(): boolean

Returns true when the badge is mounted in the page. Always false on the server.

Returns: boolean

TypeScript
if (!lynkow.branding.isVisible()) {
  // Render our own attribution
}

remove

TypeScript
remove(): void

Removes the badge and its styles from the page, and cancels an inject() still waiting for its request. Safe to call when no badge is mounted.

Returns: void

TypeScript
lynkow.branding.remove()