go get -u github.com/scalekit-inc/scalekit-sdk-goGo SDK
package 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}Changelog
View all releases →v2.0.10
What's Changed
- Sk 2390/connection docs by @AashishMehtoliya01 in #42
New Contributors
- @AashishMehtoliya01 made their first contribution in #42
Full Changelog: v2.0.9...v2.0.10
Domain List API - Release Summary
Overview
Enhanced the ListDomains API with filtering and pagination capabilities to provide more flexible and efficient domain management operations.
Changes
New Features
1. Domain Type Filtering
The ListDomains API now supports filtering domains by type:
- ALLOWED_EMAIL_DOMAIN: Filter for allowed email domains only
- ORGANIZATION_DOMAIN: Filter for organization domains only
- DOMAIN_TYPE_UNSPECIFIED: Unspecified domain 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,
})2. Pagination Support
Added pagination controls to manage large result sets:
- PageSize: Number of domains to return per page (default: 100)
- PageNumber: Page number to retrieve (1-indexed)
Usage Example:
// List domains with custom pagination
domains, err := client.Domain().ListDomains(ctx, organizationId, &scalekit.ListDomainOptions{
PageSize: 50,
PageNumber: 1,
})3. Combined Filtering and Pagination
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,
})API Signature
Before:
ListDomains(ctx context.Context, organizationId string) (*ListDomainResponse, error)After:
ListDomains(ctx context.Context, organizationId string, options ...*ListDomainOptions) (*ListDomainResponse, error)Backward Compatibility
✅ 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)New Types
ListDomainOptions
type 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
}Implementation Details
Default Behavior
- When no options are provided, the API returns all domains with a default page size of 10
- Domain type filtering is optional and can be omitted
- Pagination parameters are optional; if not specified, default page size applies
Type Conversion
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_UNSPECIFIED
Testing
Comprehensive test coverage has been added in test/domain_test.go:
- ✅ Test listing all domains (no filter)
- ✅ Test filtering by
ORGANIZATION_DOMAINtype - ✅ Test filtering by
ALLOWED_EMAIL_DOMAINtype - ✅ Test verification that filtered results only contain domains of the specified type
- ✅ Test that created domains appear in the list
Migration Guide
No Changes Required
Existing code continues to work without modification:
// Existing code - no changes needed
domains, err := client.Domain().ListDomains(ctx, organizationId)Optional: Add Filtering
To take advantage of new filtering capabilities:
// New: Filter by domain type
orgDomains, err := client.Domain().ListDomains(ctx, organizationId, &scalekit.ListDomainOptions{
DomainType: scalekit.DomainTypeOrganization,
})Benefits
- Performance: Filtering reduces unnecessary data transfer and processing
- Scalability: Pagination enables handling of large domain lists efficiently
- Flexibility: Combined filtering and pagination for precise queries
- Backward Compatibility: No breaking changes to existing implementations
Related Files
domain.go: Core implementation withListDomainOptionsand enhancedListDomainsmethodtest/domain_test.go: Comprehensive test suite includingTestListDomainsfunctionpkg/grpc/scalekit/v1/domains/: gRPC protocol buffer definitions
v2.0.9
v2.0.8
What's Changed
- Added support for Bring your own Auth for MCP Servers in #39
Full Changelog: v2.0.7...v2.0.8
v2.0.7
What's Changed
New sdk methods
- Add user management settings to organization API by @dhaneshbs in #38
Full Changelog: v2.0.6...v2.0.7
v2.0.6
What's Changed
Generate proto files to support given_name and family_name in user object in #37
Full Changelog: v2.0.5...v2.0.6
v2.0.5
What's Changed
- Added Session management sdk methods & interceptorpayload verification method #34
Full Changelog: v2.0.4...v2.0.5
v2.0.4
What's Changed
- Add CreateDomainOptions to domain creation by @dhaneshbs in #30
- Add roles and permissions support to SDK by @dhaneshbs in #35
Full Changelog: v2.0.3...v2.0.4
v2.0.3
What's Changed
- Update Scalekit SDK import paths to v2 by @dhaneshbs in #29
Full Changelog: v2.0.2...v2.0.3
v2.0.2
What's Changed
- Add ResendInvite method to UserService and Regenerate protobuf files by @dhaneshbs in #28
Full Changelog: v2.0.1...v2.0.2