SponsorkitErrorCode
Error codes carried by SponsorkitError.
Error codes carried by SponsorkitError.
invalid_config: missing or invalid configuration or options (including targets that don't exist, checked at dev time).disabled: Sponsorkit is disabled viaSPONSORKIT_DISABLE.popup_blocked: the browser blocked the sign-in/checkout popup and no redirect fallback applies.access_denied,invalid_state,provider_error: sign-in errors delivered to the callback.invalid_code: the API rejected the sign-in code exchange (400 invalid_code).cancelled: sign-in was abandoned or cancelled (popup closed,AbortSignalaborted, no code entered).timeout: sign-in exceededsignInTimeout(default 300 s).network_error: the API couldn't be reached, or returned 5xx, 429 or an unexpected response, duringsignIn()orverifySession(). CarriesSponsorkitError.retryAfterwhen the API sentRetry-After.session_invalid,targets_mismatch: only fromverifySession().
getFinancialContribution() never throws for network or server problems.
import type { SponsorkitErrorCode } from "@sponsorkit/sdk";
type SponsorkitErrorCode =
| "invalid_config"
| "disabled"
| "popup_blocked"
| "access_denied"
| "invalid_state"
| "provider_error"
| "invalid_code"
| "cancelled"
| "timeout"
| "network_error"
| "session_invalid"
| "targets_mismatch"Type alias, exported from @sponsorkit/sdk, @sponsorkit/sdk/node, @sponsorkit/sdk/server.