Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

Go

Clerk's Go SDK is a thin wrapper over the Clerk Backend API. Add the following import statement:

import "github.com/clerkinc/clerk-sdk-go/clerk"

Go doesn't automatically add the module. You can explicitly add it with:

$ go get github.com/clerkinc/clerk-sdk-go

Clerk client

Now, you can create a Clerk client by calling the clerk.NewClient() function. This function requires your Clerk secret key. If you are signed into your Clerk Dashboard, your secret key should become visible by clicking on the eye icon. Otherwise, you can retrieve your Clerk secret key from the Clerk Dashboard on the API Keys(opens in a new tab) page.

With your Clerk secret key, create a Client object to use the various services Clerk provides.

.env
client, err := clerk.NewClient(`{{secret}}`) if err != nil { // handle error }

Last updated on February 13, 2024

What did you think of this content?

Clerk © 2024