SponsorkitCoreOptions
Options shared by every Sponsorkit flavour.
On this page
Options shared by every Sponsorkit flavour.
import type { SponsorkitCoreOptions } from "@sponsorkit/sdk";
interface SponsorkitCoreOptions { … }Interface, exported from @sponsorkit/sdk, @sponsorkit/sdk/node.
Properties#
github#
github?: stringGitHub user or organization login that receives sponsorships.
openCollective#
openCollective?: stringOpen Collective collective slug that receives contributions.
cacheTtl#
cacheTtl?: numberSeconds a cached result is served without calling the API. Default 3600, minimum 60.
mock#
mock?: MockOptionMock mode: a preset name or { contributions }. Overrides SPONSORKIT_MOCK.
Type: MockOption
storage#
storage?: SponsorkitStorage | WebStorageLikeWhere the session token, cache and nag state live. Accepts a SponsorkitStorage or a Web Storage object.
Type: SponsorkitStorage, WebStorageLike
apiBaseUrl#
apiBaseUrl?: stringAPI origin used for every API call (/api/v1/…), for self-hosting and tests. Default https://api.sponsorkit.io.
An empty string counts as unset.
siteBaseUrl#
siteBaseUrl?: stringSite base URL (origin plus optional base path) used for every page: /connect/, /checkout/,
checkoutUrl() and the loopback checkout redirect. Default https://ffmathy.github.io/sponsorkit,
or apiBaseUrl when that is set and this isn't (single-origin self-hosting, tests).
An empty string counts as unset; trailing slashes are trimmed.
env#
env?: EnvEnvironment used for SPONSORKIT_DISABLE, SPONSORKIT_MOCK, SPONSORKIT_NO_NAG, SPONSORKIT_DEV_CHECKS and CI.
When given, it replaces the process environment for these variables (it is not merged). Default: the process environment.
Type: Env
devChecks#
devChecks?: booleanForces the dev-time target existence check on or off. Default: on when SPONSORKIT_DEV_CHECKS is set
(in env) or process.env.NODE_ENV is development (bundlers inline it), off otherwise.
signInTimeout#
signInTimeout?: numberSeconds to wait for a sign-in (popup, loopback or paste-back) before rejecting with timeout. Default 300.
checkoutPollInterval#
checkoutPollInterval?: numberSeconds between checkout polls. Default 60.
clock#
clock?: () => numberClock in epoch milliseconds, used for cache TTL, Retry-After and nag timing. Default Date.now.
fetch#
fetch?: FetchLikeCustom fetch implementation. Default: the global fetch.
Type: FetchLike
requestTimeout#
requestTimeout?: numberSeconds before an API request is abandoned. getFinancialContribution() then serves the stale cache;
the sign-in code exchange rejects with network_error. Default 30; 0 disables the limit.
interactive#
interactive?: booleanWhether the app runs interactively, for nag().due(). Overrides platform detection (TTY on native).