Documentation Index
Fetch the complete documentation index at: https://mintlify.com/auth0/go-auth0/llms.txt
Use this file to discover all available pages before exploring further.
The Branding API allows you to customize the look and feel of your Auth0 tenant’s login pages, including colors, logos, fonts, and themes.
Get Branding Settings
Retrieves the current branding settings for your tenant.
func (c *Client) Get(
ctx context.Context,
opts ...option.RequestOption,
) (*management.GetBrandingResponseContent, error)
branding
*management.GetBrandingResponseContent
Returns branding settings:
Colors - Color customizations
FaviconURL - Favicon URL
LogoURL - Logo URL
Font - Font settings
Example
import (
"context"
"fmt"
"log"
"github.com/auth0/go-auth0/v2/management"
)
branding, err := client.Management.Branding.Get(context.TODO())
if err != nil {
log.Fatalf("Failed to get branding: %v", err)
}
fmt.Printf("Logo URL: %s\n", branding.GetLogoURL())
fmt.Printf("Primary color: %s\n", branding.Colors.GetPrimary())
Update Branding Settings
Updates the branding settings for your tenant.
func (c *Client) Update(
ctx context.Context,
request *management.UpdateBrandingRequestContent,
opts ...option.RequestOption,
) (*management.UpdateBrandingResponseContent, error)
request
*management.UpdateBrandingRequestContent
required
The branding settings to update:
Colors - Color customizations
FaviconURL - Favicon URL
LogoURL - Logo URL
Font - Font configuration
Example
colors := &management.BrandingColors{
Primary: management.String("#007bff"),
PageBackground: &management.BrandingPageBackground{
Type: management.String("solid"),
Color: management.String("#ffffff"),
},
}
font := &management.BrandingFont{
URL: management.String("https://fonts.googleapis.com/css2?family=Roboto"),
}
update := &management.UpdateBrandingRequestContent{
Colors: colors,
LogoURL: management.String("https://example.com/logo.png"),
FaviconURL: management.String("https://example.com/favicon.ico"),
Font: font,
}
updated, err := client.Management.Branding.Update(context.TODO(), update)
if err != nil {
log.Fatalf("Failed to update branding: %v", err)
}
fmt.Println("Branding updated successfully")
Branding Components
Colors
Customize the color scheme of your login pages.
colors := &management.BrandingColors{
Primary: management.String("#007bff"), // Primary accent color
PageBackground: &management.BrandingPageBackground{
Type: management.String("solid"), // "solid" or "gradient"
Color: management.String("#ffffff"), // Background color
},
}
Font
Configure custom fonts for your login pages.
font := &management.BrandingFont{
URL: management.String("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700"),
}
Logo and Favicon
Set custom logo and favicon URLs.
branding := &management.UpdateBrandingRequestContent{
LogoURL: management.String("https://example.com/logo.png"),
FaviconURL: management.String("https://example.com/favicon.ico"),
}
Branding Templates
The Branding API also provides access to Universal Login templates.
Get Universal Login Template
template, err := client.Management.Branding.Templates.Get(context.TODO())
if err != nil {
log.Fatalf("Failed to get template: %v", err)
}
fmt.Printf("Template: %s\n", template.GetBody())
Update Universal Login Template
template := &management.UpdateBrandingTemplateRequestContent{
Template: management.String("custom-page-html"),
Body: management.String(`<!DOCTYPE html>
<html>
<head>
<title>Login</title>
</head>
<body>
{%- auth0:head -%}
{%- auth0:widget -%}
</body>
</html>`),
}
updated, err := client.Management.Branding.Templates.Update(context.TODO(), template)
if err != nil {
log.Fatalf("Failed to update template: %v", err)
}
Branding Themes
Manage branding themes for more advanced customization.
List Themes
themes, err := client.Management.Branding.Themes.List(context.TODO(), nil)
if err != nil {
log.Fatalf("Failed to list themes: %v", err)
}
for _, theme := range themes.Results {
fmt.Printf("Theme: %s\n", theme.GetName())
}
Get Theme
theme, err := client.Management.Branding.Themes.Get(
context.TODO(),
"thm_1234567890",
)
if err != nil {
log.Fatalf("Failed to get theme: %v", err)
}
Create Theme
theme := &management.CreateThemeRequestContent{
Name: "My Custom Theme",
Colors: &management.ThemeColors{
Primary: management.String("#007bff"),
PageBackground: management.String("#ffffff"),
},
}
created, err := client.Management.Branding.Themes.Create(context.TODO(), theme)
if err != nil {
log.Fatalf("Failed to create theme: %v", err)
}
Complete Example
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/auth0/go-auth0/v2/management"
)
func main() {
client, err := management.New(
context.TODO(),
os.Getenv("AUTH0_DOMAIN"),
management.WithClientCredentials(
os.Getenv("AUTH0_CLIENT_ID"),
os.Getenv("AUTH0_CLIENT_SECRET"),
),
)
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
// Get current branding
current, err := client.Management.Branding.Get(context.TODO())
if err != nil {
log.Fatalf("Failed to get branding: %v", err)
}
fmt.Printf("Current logo: %s\n", current.GetLogoURL())
// Update branding
colors := &management.BrandingColors{
Primary: management.String("#007bff"),
PageBackground: &management.BrandingPageBackground{
Type: management.String("solid"),
Color: management.String("#f8f9fa"),
},
}
update := &management.UpdateBrandingRequestContent{
Colors: colors,
LogoURL: management.String("https://example.com/new-logo.png"),
FaviconURL: management.String("https://example.com/favicon.ico"),
}
updated, err := client.Management.Branding.Update(context.TODO(), update)
if err != nil {
log.Fatalf("Failed to update branding: %v", err)
}
fmt.Printf("Updated logo: %s\n", updated.GetLogoURL())
}
Best Practices
- Use HTTPS - Always use HTTPS URLs for logos and favicons
- Optimize Images - Use appropriately sized images to ensure fast loading
- Test Colors - Test color combinations for accessibility and contrast
- Preview Changes - Use Universal Login preview before deploying
- Web Fonts - Use web-safe fonts or properly licensed web fonts