If you want to use a service account you need to set an environment variable as explains
here. But I believe you need to use '
User accounts' to authenticate to a GCP API concerning your comment. You can authenticate users directly to your application, when the application needs to access resources on behalf of an end user. Generally, you can authenticate to a Google Cloud Platform API using service accounts or user accounts.