SponsorkitErrorCodes

The values of SponsorkitError.Code.

On this page

The values of SponsorkitError.Code.

namespace Sponsorkit;

public static class SponsorkitErrorCodes

Constants#

MemberDescription
InvalidConfigMissing or invalid configuration: no targets, a malformed target, an unknown mock preset, invalid checkout options, or (dev-time check) a target that does not exist.
DisabledSponsorkit is disabled through SPONSORKIT_DISABLE.
PopupBlockedBrowser only; never thrown by the .NET SDK.
AccessDeniedThe supporter denied access at the provider.
InvalidStateThe sign-in state expired or could not be verified.
ProviderErrorThe provider failed during sign-in.
InvalidCodeThe API rejected the sign-in code exchange (400 invalid_code): the code is malformed or expired, or the PKCE verifier did not match.
CancelledSign-in was abandoned or cancelled through its CancellationToken, or no paste-back code was entered.
TimeoutSign-in did not complete within SponsorkitOptions.SignInTimeout (default 5 minutes).
NetworkErrorDuring sign-in or SponsorkitServer.VerifySessionAsync, the API could not be reached or answered 5xx, 429 or an unexpected response.
SessionInvalidThe session token is invalid or expired.
TargetsMismatchThe session is bound to a different target set.

InvalidConfig#

public const string InvalidConfig = "invalid_config";

Missing or invalid configuration: no targets, a malformed target, an unknown mock preset, invalid checkout options, or (dev-time check) a target that does not exist.

Value: "invalid_config"

Disabled#

public const string Disabled = "disabled";

Sponsorkit is disabled through SPONSORKIT_DISABLE.

Value: "disabled"

PopupBlocked#

public const string PopupBlocked = "popup_blocked";

Browser only; never thrown by the .NET SDK. Listed for parity with the protocol.

Value: "popup_blocked"

AccessDenied#

public const string AccessDenied = "access_denied";

The supporter denied access at the provider.

Value: "access_denied"

InvalidState#

public const string InvalidState = "invalid_state";

The sign-in state expired or could not be verified.

Value: "invalid_state"

ProviderError#

public const string ProviderError = "provider_error";

The provider failed during sign-in.

Value: "provider_error"

InvalidCode#

public const string InvalidCode = "invalid_code";

The API rejected the sign-in code exchange (400 invalid_code): the code is malformed or expired, or the PKCE verifier did not match.

Value: "invalid_code"

Cancelled#

public const string Cancelled = "cancelled";

Sign-in was abandoned or cancelled through its CancellationToken, or no paste-back code was entered.

Value: "cancelled"

Timeout#

public const string Timeout = "timeout";

Sign-in did not complete within SponsorkitOptions.SignInTimeout (default 5 minutes).

Value: "timeout"

NetworkError#

public const string NetworkError = "network_error";

During sign-in or SponsorkitServer.VerifySessionAsync, the API could not be reached or answered 5xx, 429 or an unexpected response. SponsorkitError.RetryAfter is set when the API sent Retry-After.

Value: "network_error"

SessionInvalid#

public const string SessionInvalid = "session_invalid";

The session token is invalid or expired. Only thrown by SponsorkitServer.VerifySessionAsync.

Value: "session_invalid"

TargetsMismatch#

public const string TargetsMismatch = "targets_mismatch";

The session is bound to a different target set. Only thrown by SponsorkitServer.VerifySessionAsync.

Value: "targets_mismatch"