SponsorkitServer
Backend helpers.
Backend helpers. They use no local storage.
namespace Sponsorkit;
public static class SponsorkitServerMethods#
| Member | Description |
|---|---|
VerifySessionAsync(string, VerifySessionOptions, CancellationToken) | Verifies a session token forwarded by your frontend or app: asks Sponsorkit for the live contribution result and checks that the session is bound to exactly the expected target set. |
VerifySessionAsync(string, VerifySessionOptions, CancellationToken)#
public static Task<ContributionResult> VerifySessionAsync(string sessionToken, VerifySessionOptions options, CancellationToken cancellationToken = default)Verifies a session token forwarded by your frontend or app: asks Sponsorkit for the live contribution result and checks that the session is bound to exactly the expected target set. Sealed tokens cannot be forged, so the result can be trusted.
Parameters
sessionTokenstring: The supporter'ssks_…session token.optionsVerifySessionOptions: The expected targets.cancellationTokenCancellationToken: Cancels the request. Optional (defaultdefault).
Returns Task<ContributionResult> (ContributionResult): The live contribution result.
Exceptions
SponsorkitError:session_invalid(rejected or malformed token),targets_mismatch,invalid_config(bad expected targets), ornetwork_error(unreachable, 5xx, 429 or an unexpected response;SponsorkitError.RetryAfteris set when the API sentRetry-After).OperationCanceledException: ThecancellationTokenwas cancelled.