SponsorkitBadgeElement
<sponsorkit-badge github open-collective>: shows "Supporter ♥" when the signed-in user has an active contribution, and nothing otherwise.
On this page
<sponsorkit-badge github open-collective>: shows "Supporter ♥" when the
signed-in user has an active contribution, and nothing otherwise.
Call refresh() after signing in or checking out.
import { SponsorkitBadgeElement } from "@sponsorkit/sdk/elements";
class SponsorkitBadgeElement extends SponsorkitElementBase { … }Class, exported from @sponsorkit/sdk/elements.
Properties#
client#
set client(client: Sponsorkit | null)
get client(): Sponsorkit | nullUse a pre-configured client instead of one built from attributes.
The client for this element (built from the github, open-collective, api-base-url and site-base-url attributes).
Methods#
connectedCallback()#
connectedCallback(): voidReturns void
attributeChangedCallback()#
attributeChangedCallback(): voidReturns void
refresh()#
async refresh(): Promise<boolean>Re-reads the contribution (served from cache when fresh) and updates visibility. Resolves whether the badge is shown.
Returns Promise<boolean>
Static members#
SponsorkitBadgeElement.observedAttributes#
static readonly observedAttributes = ["github", "open-collective", "api-base-url", "site-base-url"]