Skip to content

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 09 Oct 09:45
cae5b1d

What's New in v2.0.0

⚠️ BREAKING CHANGES - Major Rewrite

This is a complete rewrite of the Auth0 Go SDK with significant breaking changes from v1.x. Users will need to update their code when migrating from v1.x to v2.0.0.

Added Features

  • New OpenAPI-generated SDK: Complete rewrite generated from Auth0's OpenAPI specifications
  • Hierarchical package structure: Organized management APIs into logical subpackages
  • Strongly typed interfaces: Specific request/response types replace generic interfaces
  • Enhanced type safety: Enums and constants replace string literals
  • Improved error handling: Structured error types with better error messages
  • Better IntelliSense support: Improved code completion and documentation

Key Breaking Changes

  • Module name changed from github.com/auth0/go-auth0 to github.com/auth0/go-auth0/v2
  • Client initialization changed from management.New() to client.New() with new option pattern
  • Manager structure changed from flat (mgmt.User) to hierarchical (mgmt.Users)
  • Method signatures now require specific request objects instead of generic structs
  • Response types are now specific to each operation
  • Package organization changed from flat structure to organized subpackages
  • Configuration pattern changed to use option.RequestOption types

Migration Example

Before (v1):

import "github.com/auth0/go-auth0/management"

mgmt, err := management.New(domain,
    management.WithClientCredentials(ctx, clientID, clientSecret))

client := &management.Client{
    Name: auth0.String("My App"),
    AppType: auth0.String("spa"),
}
err := mgmt.Client.Create(ctx, client)

After (v2):

import (
    "github.com/auth0/go-auth0/v2/management"
    "github.com/auth0/go-auth0/v2/management/client"
    "github.com/auth0/go-auth0/v2/option"
)

mgmt, err := client.New("your-domain.auth0.com",
    option.WithClientCredentials(ctx, clientID, clientSecret))

request := &management.CreateClientRequestContent{
    Name: "My App",
    AppType: &management.ClientAppTypeEnumSpa,
}
response, err := mgmt.Clients.Create(ctx, request)

Important Notes

  • ✅ The authentication package is NOT affected by these changes. Authentication APIs remain the same between V1 and V2.
  • 📖 Complete migration guide available at MIGRATION_GUIDE.md
  • 🔄 This is the stable GA release following v2.0.0-beta.0