Contribution shape

The result every SDK returns, field by field, how each language names the fields, and the helpers that filter it.

On this page

getFinancialContribution() returns the same data in every SDK. It's raw: one entry per sponsorship or order, per provider, in the provider's own currency. Sponsorkit never sums, converts or ranks contributions, because only you know what should count.

ContributionResult
{
  "signedIn": true,
  "disabled": false,
  "mock": false,
  "targets": ["github:octocat", "open-collective:my-collective"],
  "supporter": {
    "id": "sup_…",
    "identities": [{ "provider": "github", "id": "583231", "handle": "alice", "needsReconnect": false }]
  },
  "contributions": [{
    "id": "con_github_…",
    "provider": "github",
    "target": "github:octocat",
    "sponsor": { "type": "user", "provider": "github", "id": "583231", "handle": "alice" },
    "via": "direct",
    "kind": "recurring",
    "frequency": "monthly",
    "status": "active",
    "amount": { "value": 500, "currency": "USD" },
    "tier": { "id": "ST_…", "name": "Coffee" },
    "flags": [],
    "private": false,
    "startedAt": "2026-03-01T10:00:00Z",
    "endedAt": null,
    "lastChargedAt": null,
    "nextChargeAt": null,
    "totalContributed": null
  }],
  "fetchedAt": "2026-11-16T18:00:00Z",
  "stale": false,
  "fromCache": false
}

The result#

FieldTypeMeaning
signedInbooleanA session token is stored. false means no network call was made.
disabledbooleanSPONSORKIT_DISABLE is set: no network, no disk, always signed out.
mockbooleanThe result comes from mock mode.
targetsstring[]The canonical target set, such as github:octocat.
supporterobject or nullnull when signed out. See the supporter.
contributionsContribution[]Contributions to your targets, from both providers. Empty when signed out.
fetchedAttimestamp or nullWhen the API produced this data. null when nothing was fetched yet.
stalebooleanSome provider couldn't be reached and its data, if any, comes from the local cache.
fromCachebooleanThe whole result came from the local cache: either it was fresh, or the request failed.
unavailableprovider[], optionalPresent on fresh API results when a provider couldn't be queried.

When signed out, disabled or in a mock preset without a supporter, supporter is null and contributions is empty. Caching & freshness explains stale and fromCache.

The supporter#

FieldMeaning
supporter.idsup_…, a pairwise id: stable for the same person and the same target set, and different for apps with other targets, so apps can't correlate users. Derived from the session's first identity.
identities[].providergithub or open-collective.
identities[].idThe provider's immutable user id.
identities[].handleThe login or slug, or null. Handles can change; key your data on supporter.id or id.
identities[].needsReconnectThe provider permission expired or was revoked; see reconnecting.

A contribution#

FieldValuesMeaning
idcon_<provider>_…Stable, derived from the provider's own id.
providergithub, open-collectiveWhere the contribution was made.
targete.g. github:octocatWhich of your targets it goes to.
sponsor{ type, provider, id, handle }Who pays: type is user, or organization for organization sponsorships.
viadirect, organizationWhether the supporter pays personally or through an organization.
kindrecurring, one_time
frequencymonthly, yearly, one_timeGitHub has monthly and one-time; Open Collective also has yearly.
statusactive, paused, cancelled, paid, refunded, disputed, failed, pendingSee statuses.
amount{ value, currency }Per charge, in minor units: 500 with USD is $5.00.
tier{ id, name } or nullThe provider's tier, when there is one.
flags["via_patreon"] or []via_patreon: a GitHub sponsorship paid through Patreon.
privatebooleanThe supporter made it private (GitHub) or incognito (Open Collective). Your app sees it because the supporter consented; don't display it publicly.
startedAt, endedAttimestamp or nullISO 8601.
lastChargedAt, nextChargeAttimestamp or nullOpen Collective only.
totalContributed{ value, currency } or nullOpen Collective only: everything paid so far.

Amounts#

  • Minor units follow ISO 4217: two decimals for most currencies, none for JPY or KRW, three for KWD. Divide by the right power of ten before showing an amount.
  • GitHub is always USD. Open Collective uses the collective's currency.
  • Hidden GitHub amounts. When GitHub doesn't reveal the tier, amount is { value: 0, currency: "USD" } and tier is null. Rules like "at least $5" then treat the sponsorship as $0, so decide whether "any active GitHub sponsorship" should count too.

Names in each language#

The JSON field names are the wire format, and every SDK serializes back to exactly this shape. In code, each SDK follows its language's conventions:

JSONJavaScript.NETPythonGoRust
signedInsignedInSignedInsigned_inSignedInsigned_in
fromCachefromCacheFromCachefrom_cacheFromCachefrom_cache
amount.valueamount.valueAmount.Value (long)amount.valueAmount.Value (int64)amount.value (i64)
privateprivateIsPrivateprivatePrivateprivate
sponsor.typesponsor.typeSponsor.Typesponsor.typeSponsor.Typesponsor.kind
startedAtstringDateTimeOffset?str*stringOption<String>
statusstring unionstring, ContributionStatuses.*Literal stringsponsorkit.Status*Status enum

Nullable strings such as handle are string | null, string?, str | None, *string and Option<String>. The Rust enums Status and Flag have an Other(String) variant, so a value added to the protocol later won't break deserialization.

Helpers#

The result has five filters. They only filter; they never sum across providers or currencies.

HelperKeeps
active()status is active
recurring()kind is recurring, any status
oneTime()kind is one_time, any status
byProvider(p)One provider
direct()via is direct: drops organization sponsorships

Each returns a plain list, so combine them with your language's own filtering:

const fc = await sk.getFinancialContribution();

// Your rule: at least $5 on any active USD contribution.
const isSupporter = fc.active().some((c) => c.amount.currency === "USD" && c.amount.value >= 500);
const githubOnly = fc.byProvider("github");
const everPaid = fc.oneTime().some((c) => c.status === "paid");

Each SDK's API reference lists the exact types: JavaScript, .NET, Python, Go and Rust.