Skip to main content

Prerequisites

Before getting started:

Instantiating the PrivyClient

Import the go-sdk package and create a new client instance by passing the Privy app ID and app secret as parameters.
package main

import (
	privy "github.com/privy-io/go-sdk"
)

func main() {
	client := privy.NewPrivyClient(privy.PrivyClientOptions{
		AppID:     "your-privy-app-id",
		AppSecret: "your-app-secret",
	})
}
This client is the entry point for managing Privy resources from a server. The PrivyClient provides methods for creating wallets, signing and sending transactions, retrieving user objects, verifying auth tokens, and querying users.

Authorization

If a resource (i.e. wallet, policy, or key quorum) has an owner, authorization signatures from the owner are required. The authorization context accepts authorization private keys and user JWTs of the wallet’s owners. The Go SDK generates signatures and signs requests automatically.
Review the signing on the server guide before using the Go SDK for the best development experience.
import "github.com/privy-io/go-sdk/authorization"

authCtx := authorization.AuthorizationContext{
	PrivateKeys: []string{"privateKey1", "privateKey2"},
	UserJwts:    []string{"jwt1", "jwt2"},
}

Rate limits

Privy rate limits REST API endpoints called from a server.
Learn more about optimizing request patterns and handling rate limits in the optimizing guide.

Next steps