Skip to main content
The source contains a root truthlock package and a legacy pkg client. They are different interfaces; do not mix method names or request types from one with the other. The root module path is:
Install the corrected public module with go get github.com/truthlocks/sdk-go@v0.4.0. Older tags used an incompatible module path.

Client configuration

This is a fragment for a Go program importing the module, os, and context. Use a key matching the host. Tenant ID alone is not authentication; the server derives the workspace from the credential.

Minting

The root client accepts MintRequest with IssuerID, KID, Alg, and PayloadB64URL. Encode original bytes with base64.RawURLEncoding.EncodeToString. Alternatively, set Schema and Claims and leave PayloadB64URL empty to use structured input. Do not combine the two input modes.
This fragment belongs in a function returning error; import encoding/base64 and fmt, and provide ctx. Use an issuer and signing key already provisioned for the environment.

Request and response contracts

The corrected root transport performs HTTP requests and surfaces HTTP and JSON errors. Earlier source snapshots contained a no-op transport; do not treat a successful return from such a version as evidence that a request reached Truthlocks. Verify your pinned source version. Keep a stable idempotency key across retries of one write and the same body. Do not assume a new SDK method call reuses the previous key. Handle cancellation and errors explicitly; never discard mint or verification errors. Use the API reference for wire fields and the direct HTTP quickstart when checking a package version’s behavior.