6 "github.com/zmb3/spotify"
7 "golang.org/x/oauth2/clientcredentials"
11 func Get() (*spotify.Client, error) {
12 config := &clientcredentials.Config{
13 ClientID: os.Getenv("SPOTIFY_ID"),
14 ClientSecret: os.Getenv("SPOTIFY_SECRET"),
15 TokenURL: spotify.TokenURL,
18 token, err := config.Token(context.Background())
20 return nil, fmt.Errorf("client: %w", err)
23 client := spotify.Authenticator{}.NewClient(token)
24 client.AutoRetry = true