func fetchToken() (*firebase.FirestoreSpotifyAuthToken, error) {
	logger.Log("FetchToken", "Starting...")
	snapshot, snapshotErr := firestoreClient.Collection("internal_tokens").Doc("spotifyAuthToken").Get(context.Background())
	if status.Code(snapshotErr) == codes.NotFound {
		logger.Log("FetchToken", "SpotifyAuthToken not found in DB. Need to create.")
		return nil, nil
	}
	if snapshotErr != nil {
		return nil, fmt.Errorf(snapshotErr.Error())
	}
	logger.Log("FetchToken", "Successfully got snapshot.")
	var spotifyAuthToken firebase.FirestoreSpotifyAuthToken
	dataToErr := snapshot.DataTo(&spotifyAuthToken)
	if dataToErr != nil {
		return nil, fmt.Errorf(dataToErr.Error())
	}
	logger.Log("FetchToken", "Successfully decoded auth token.")
	return &spotifyAuthToken, nil
}
fetchToken will grab the Apple Developer Token from DB
package getspotifymedia
import (
	"context"
	"encoding/base64"
	"encoding/json"
	"fmt"
	"net/http"
	"net/url"
	"os"
	"strings"
	"time"
	"cloud.google.com/go/firestore"
	"github.com/pixelogicdev/gruveebackend/pkg/firebase"
	"github.com/pixelogicdev/gruveebackend/pkg/social"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
)
func initWithEnv() error {
	var currentProject string
	if os.Getenv("ENVIRONMENT") == "DEV" {
		currentProject = os.Getenv("FIREBASE_PROJECTID_DEV")
	} else if os.Getenv("ENVIRONMENT") == "PROD" {
		currentProject = os.Getenv("FIREBASE_PROJECTID_PROD")
	}
	httpClient = &http.Client{}
	client, err := firestore.NewClient(context.Background(), currentProject)
	if err != nil {
		return fmt.Errorf("CreateUser [Init Firestore]: %v", err)
	}
	firestoreClient = client
	return nil
}
func getCreds() (*firebase.FirestoreSpotifyAuthToken, error) {
	logger.Log("GetCreds", "Starting...")
	if os.Getenv("SPOTIFY_CLIENTID") == "" || os.Getenv("SPOTIFY_SECRET") == "" {
		return nil, fmt.Errorf("getSpotifyMedia [Check Env Props]: PROPS NOT HERE")
	}
	logger.Log("GetCreds", "Found Spotify ClientID in env variables")
	authToken, authTokenErr := fetchToken()
	if authTokenErr != nil {
		return nil, authTokenErr
	}
	logger.Log("GetCreds", "Received token.")
	if authToken != nil {
		logger.Log("GetCreds", "Checking to see if token needs to be refreshed")
		latestCreds, refreshAuthTokenErr := refreshAuthToken(*authToken)
		if refreshAuthTokenErr != nil {
			return nil, refreshAuthTokenErr
		}
		logger.Log("GetCreds", "Auth token refresh complete.")
		return latestCreds, nil
	}
	logger.Log("GetCreds", "No auth token found.")
	newAuthToken, newAuthTokenErr := generateAuthToken()
	if newAuthTokenErr != nil {
		return nil, newAuthTokenErr
	}
	logger.Log("GetCreds", "Successfully generated new auth token.")
	writeSpotifyAuthErr := writeSpotifyAuthtoken(*newAuthToken)
	if writeSpotifyAuthErr != nil {
		return nil, writeSpotifyAuthErr
	}
	logger.Log("GetCreds", "Successfully stored new auth token in DB.")
	return newAuthToken, nil
}