What's Changed
- [SK-1339] feat: typed UpdateLoginUserDetails response, issuer validation, listEventsPaginated by @AkshayParihar33 in #88
Full Changelog: v2.7.0...v2.8.0
go get -u github.com/scalekit-inc/scalekit-sdk-gopackage main
import ( "os" "github.com/scalekit-inc/scalekit-sdk-go/scalekit")
func main() { scalekitClient := scalekit.NewScalekitClient( os.Getenv("SCALEKIT_ENVIRONMENT_URL"), os.Getenv("SCALEKIT_CLIENT_ID"), os.Getenv("SCALEKIT_CLIENT_SECRET"), ) // Use scalekitClient for authentication}Full Changelog: v2.7.0...v2.8.0
Full Changelog: v2.6.0...v2.7.0
Full Changelog: v2.5.0...v2.6.0
Full Changelog: v2.4.0...v2.5.0
Client() APIs for client CRUD and client secret management.GeneratePKCEConfiguration(...) for public client authorization flows.WithSecret(...) to derive a secret-enabled client without mutating the original client.ValidateTokenWithOptions(...) with audience and scope validation support.NewScalekitClient(...) now supports initialization without a client secret for public clients while preserving backward compatibility.GenerateClientToken(...) now accepts structured options and returns token metadata.RefreshAccessToken(...) now includes id_token in the response.AuthenticateWithCode(...) and RefreshAccessToken(...) now send client_secret only when configured.Release date: 2026-03-06
Previous release: v2.1.0 (2026-02-24)
| # | Title |
|---|---|
| #45 | API tokens |
| #50 | chore: add CODEOWNERS |
| #58 | Structured error handling, sentinel errors, and thread-safe client |
token.go)A new TokenClient is available on ScalekitClient for managing API tokens programmatically:
// Example
token, err := client.Token().CreateToken(ctx, scalekit.CreateTokenOptions{...})Non-2xx HTTP responses are now surfaced as *scalekit.Error with an inspectable StatusCode field:
var e *scalekit.Error
if errors.As(err, &e) {
fmt.Println(e.StatusCode) // e.g. 403
}Callers can now use errors.Is instead of string matching for common failure modes:
| Sentinel | Condition |
|---|---|
ErrTokenRequired |
empty token passed to ValidateToken |
ErrTokenValidationFailed |
token validation connect error |
ErrMissingExpClaim |
token lacks exp claim |
ErrCodeOrLinkTokenRequired |
missing code/link token |
ErrOrganizationIdRequired |
missing org ID |
ErrDirectoryNotFound |
directory lookup returned nothing |
accessToken and jsonWebKeySet now use atomic.Pointer with singleflight groups — eliminates data races on concurrent requests.withDefaultTimeout. Callers with their own context.Deadline are unaffected.CodeUnauthenticated responses only; authenticateClient failures are propagated instead of silently ignored.x-api-version header updated to 20260226.None. A potentially breaking change (removal of external ID field) was reverted before this release. All existing method signatures remain compatible with v2.1.0.
.github/CODEOWNERS to enforce required reviews on all PRs (owners: @AkshayParihar33, @dhawani).ListTokensRequest.UserId changed to *string pointer.go.mod updated.go get github.com/scalekit-inc/scalekit-sdk-go/v2@v2.2.0All methods that make network calls now require a context.Context as the first argument to support cancellation or timeout propagation.
| Method | Old Signature | New Signature |
|---|---|---|
AuthenticateWithCode |
(code, redirectUri, options) |
(ctx, code, redirectUri, options) |
ValidateAccessToken |
(accessToken) |
(ctx, accessToken) |
GetAccessTokenClaims |
(accessToken) |
(ctx, accessToken) |
GetIdpInitiatedLoginClaims |
(token) |
(ctx, token) |
RefreshAccessToken |
(refreshToken) |
(ctx, refreshToken) |
ValidateToken |
(token, jwksFn) |
(ctx, token, jwksFn) |
Migration: Pass ctx as the first argument.
// Before
scalekitClient.AuthenticateWithCode(token)
// After
scalekitClient.AuthenticateWithCode(ctx, token)Connection.CreateConnection — programmatically create SSO connections for an organizationConnection.DeleteConnection — delete an existing SSO connectionDirectory.CreateDirectory — programmatically create a directory for an organizationDirectory.DeleteDirectory — delete an existing directoryFull Changelog: v2.0.10...v2.0.11
Full Changelog: v2.0.9...v2.0.10
Enhanced the ListDomains API with filtering and pagination capabilities to provide more flexible and efficient domain management operations.
The ListDomains API now supports filtering domains by type:
Usage Example:
// List only organization domains
orgDomains, err := client.Domain().ListDomains(ctx, organizationId, &scalekit.ListDomainOptions{
DomainType: scalekit.DomainTypeOrganization,
})
// List only allowed email domains
allowedEmailDomains, err := client.Domain().ListDomains(ctx, organizationId, &scalekit.ListDomainOptions{
DomainType: scalekit.DomainTypeAllowedEmail,
})Added pagination controls to manage large result sets:
Usage Example:
// List domains with custom pagination
domains, err := client.Domain().ListDomains(ctx, organizationId, &scalekit.ListDomainOptions{
PageSize: 50,
PageNumber: 1,
})Filter and paginate simultaneously for efficient domain queries:
Usage Example:
// List organization domains with pagination
orgDomains, err := client.Domain().ListDomains(ctx, organizationId, &scalekit.ListDomainOptions{
DomainType: scalekit.DomainTypeOrganization,
PageSize: 25,
PageNumber: 1,
})Before:
ListDomains(ctx context.Context, organizationId string) (*ListDomainResponse, error)After:
ListDomains(ctx context.Context, organizationId string, options ...*ListDomainOptions) (*ListDomainResponse, error)✅ Fully backward compatible - The API can still be called without options:
// Still works - returns all domains with default page size of 10
allDomains, err := client.Domain().ListDomains(ctx, organizationId)ListDomainOptionstype ListDomainOptions struct {
DomainType DomainType // Optional: Filter by domain type
PageSize uint32 // Optional: Number of results per page (default: 10)
PageNumber uint32 // Optional: Page number to retrieve
}The SDK automatically converts string domain type constants to the appropriate gRPC enum values:
scalekit.DomainTypeAllowedEmail → domains.DomainType_ALLOWED_EMAIL_DOMAINscalekit.DomainTypeOrganization → domains.DomainType_ORGANIZATION_DOMAINscalekit.DomainTypeUnspecified → domains.DomainType_DOMAIN_TYPE_UNSPECIFIEDComprehensive test coverage has been added in test/domain_test.go:
ORGANIZATION_DOMAIN typeALLOWED_EMAIL_DOMAIN typeExisting code continues to work without modification:
// Existing code - no changes needed
domains, err := client.Domain().ListDomains(ctx, organizationId)To take advantage of new filtering capabilities:
// New: Filter by domain type
orgDomains, err := client.Domain().ListDomains(ctx, organizationId, &scalekit.ListDomainOptions{
DomainType: scalekit.DomainTypeOrganization,
})domain.go: Core implementation with ListDomainOptions and enhanced ListDomains methodtest/domain_test.go: Comprehensive test suite including TestListDomains functionpkg/grpc/scalekit/v1/domains/: gRPC protocol buffer definitions