SponsorkitButtonElement

<sponsorkit-button github open-collective amount currency frequency provider>: opens checkout (synchronously, in a popup) when clicked.

On this page

<sponsorkit-button github open-collective amount currency frequency provider>: opens checkout (synchronously, in a popup) when clicked.

Events: sponsorkit:checkout (detail = CheckoutResult), sponsorkit:error (detail.error).

import { SponsorkitButtonElement } from "@sponsorkit/sdk/elements";

class SponsorkitButtonElement extends SponsorkitElementBase { … }

Class, exported from @sponsorkit/sdk/elements.

Properties#

client#

set client(client: Sponsorkit | null)
get client(): Sponsorkit | null

Use 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(): void

Returns void

attributeChangedCallback()#

attributeChangedCallback(): void

Returns void

checkout()#

checkout(): void

Opens checkout with the element's attributes. Must run in a user gesture (it opens a popup synchronously).

Returns void

Static members#

SponsorkitButtonElement.observedAttributes#

static readonly observedAttributes = ["label"]