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 | 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
checkout()#
checkout(): voidOpens 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"]