settlekit/docs/RELEASING-SDKS.md
caelum0x 7ad4ec44c0 fix(sdk-go): VerifyEntitlement decoded the wrong field — always "not allowed"
VerifyEntitlementResult.Granted had json tag "granted", but the real API
(apps/api/src/routes/entitlements.ts -> packages/entitlements's
EntitlementService.verify / ServiceVerifyResult) has only ever returned
"allowed". encoding/json leaves unmatched fields at their zero value, so
Granted silently decoded to false for every real response — any Go backend
gating paid access via this SDK denied every real, fully-paid customer, with
no error ever raised. Same bug shape as the already-fixed Python x402
verifier (a27d0051): an SDK's only production path silently rejecting
everything real.

Rename Granted -> Allowed (json:"allowed"), add the Entitlement and Value
fields the API actually returns, and give Raw a real UnmarshalJSON instead of
a json:"-" tag that silently excluded it from ever being populated despite the
doc comment's "preserved in Raw" claim. Add Email support to
VerifyEntitlementInput/ListEntitlementsOptions, matching the API's own
"check by the buyer's checkout email instead of a customer id" capability,
which the Go SDK had no way to express. Add the first regression tests for
this file (sdks/go had none): one that would not even compile against the old
field names, proving this isn't a cosmetic rename.

Also fix a second real blocker for any Go developer trying to use this SDK at
all: go.mod's module path (github.com/settlekit/settlekit-go) and every
README/docs reference to it pointed at a GitHub org that does not exist
(confirmed 404 on github.com and the Go module proxy) — `go get` of the
documented path fails for everyone. Changed the module path to this
repository's real path (github.com/caelum0x/settlekit/sdks/go) and updated
sdks/go/README.md, docs/WEBHOOKS.md, docs/RELEASING-SDKS.md to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-26 17:47:07 +03:00

1.5 KiB

Releasing the SDKs

SDK Package Version Registry
TypeScript @settlekit/sdk (+ @settlekit/common) 0.1.0 npm
React @settlekit/react 0.1.0 npm
Python settlekit 0.1.0 PyPI
Rust settlekit 0.1.0 crates.io
Go github.com/caelum0x/settlekit/sdks/go v0.1.0 Go module proxy (tag)

All SDKs verify webhook signatures that carry one v1 per active secret (secret rotation).

One-time setup (owner)

  1. npm: create the @settlekit organization, then add an automation token as the NPM_TOKEN repository secret.
  2. PyPI: create the settlekit project and add this repository's release-sdks workflow as a trusted publisher.
  3. crates.io: reserve settlekit and add CARGO_REGISTRY_TOKEN as a repository secret.
  4. Go: DONE — github.com/settlekit is not a real GitHub org (404s; confirmed against both GitHub and the Go module proxy), so sdks/go/go.mod's module path was changed to github.com/caelum0x/settlekit/sdks/go (this repository's real path). Still needed: tag sdks/go/v0.1.0 so go get resolves a real version instead of a pseudo-version off main.
  5. Confirm the MIT licence in each SDK's LICENSE file.

Release

# bump versions in packages/{common,sdk,react}/package.json, sdks/python/pyproject.toml, sdks/rust/Cargo.toml
git tag sdk-v0.1.0 && git push origin sdk-v0.1.0

Run the workflow manually with dry_run to build and pack without publishing.