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>
1.5 KiB
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)
- npm: create the
@settlekitorganization, then add an automation token as theNPM_TOKENrepository secret. - PyPI: create the
settlekitproject and add this repository'srelease-sdksworkflow as a trusted publisher. - crates.io: reserve
settlekitand addCARGO_REGISTRY_TOKENas a repository secret. - Go: DONE —
github.com/settlekitis not a real GitHub org (404s; confirmed against both GitHub and the Go module proxy), sosdks/go/go.mod's module path was changed togithub.com/caelum0x/settlekit/sdks/go(this repository's real path). Still needed: tagsdks/go/v0.1.0sogo getresolves a real version instead of a pseudo-version offmain. - Confirm the MIT licence in each SDK's
LICENSEfile.
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.