Prerequisites
Before installing the Auth0 Go SDK, ensure your environment meets these requirements:Go version
Install Go 1.24 or newer. The SDK follows the same support policy as Go, supporting the last two major releases.Verify your Go installation:
Auth0 account
Create a free Auth0 account if you don’t have one.
Auth0 application
Create an Auth0 application in your Auth0 Dashboard to obtain your credentials:
- For Authentication API: Create a Regular Web Application, Single Page Application, or Native Application
- For Management API: Create a Machine to Machine Application and authorize it for the Auth0 Management API
Install the SDK
Install the Auth0 Go SDK using Go modules:go.mod file.
The SDK uses semantic versioning. The
/v2 suffix in the import path indicates you’re using version 2.x of the SDK.Gather your credentials
You’ll need different credentials depending on which API you’re using.Authentication API credentials
For the Authentication API, you need:Navigate to your application
Go to the Auth0 Dashboard and select Applications > Applications.
Management API credentials
For the Management API, you need:Create a Machine to Machine application
In the Auth0 Dashboard, go to Applications > Applications and create a new Machine to Machine Application.
Authorize for Management API
When prompted, select the Auth0 Management API and grant the necessary permissions (scopes) for your use case.
Store credentials securely
Never hardcode credentials in your source code. Use one of these approaches:Environment variables
Create a.env file in your project root:
.env to your .gitignore:
Configuration file
Create a configuration file outside your repository:Import the SDK
Once installed, import the SDK packages you need:Verify installation
Create a simple program to verify the SDK is installed correctly:main.go
Next steps
Quick start
Build your first integration with complete examples
API reference
Explore the complete API documentation