Go SDK
The OhAuthCat server SDK for Go 1.26: management API, SSO helpers and webhook verification, standard library only.
Go 1.26 or later. Its runtime imports only the standard library. Import it as ohauthcat "ohauthcat..
Install
Section titled “Install”go get ohauthcat.com/sdk-go@v0.0.2Configure
Section titled “Configure”ohauthcat. returns the client and an error; defer client.Close(). For sign-in also set ClientID (pk_...) and EnvironmentID (env_...). Optional: Timeout, MaxRetries, and APIBaseURL / AuthBaseURL for any deployment other than production.
First call
Section titled “First call”Generated methods sit on each resource and take a context and an arguments value: client.. Every list operation also has an iterator whose name ends in All, for example for org, err :; client.Events.List is the same for events.
SSO: client., GetProfileAndToken and VerifyAccessToken. See working with existing auth for a Go example.
Errors
Section titled “Errors”API errors are *ohauthcat.APIError with Code, Status, Type, Param, DocURL and RequestID; check them with errors.As. See the error codes. *ohauthcat. means the code exchange cannot be retried: start a fresh sign-in. Error strings never contain response messages, URLs or credentials.
Webhooks
Section titled “Webhooks”ohauthcat. checks the exact raw body bytes and returns the event. Pass every secret you hold during a rotation. A refusal is a *ohauthcat. with a Code. The default freshness tolerance is 300 seconds.
Reference
Section titled “Reference”Every method maps to an operation in the API reference; webhook payloads are in webhook events.