Skip to content

Feature request: make environment variables compatible with google-cloud-ruby #1852

Closed

Description

@timanovsky

It would be nice if node and ruby applications can use the same configuration environment variables, and same preceding logic. In my particular project I'm using two variables: DATASTORE_EMULATOR_HOST and GCLOUD_KEYFILE_JSON. First have higher priority. If it is unset, datastore client goes to service endpoint specified by content of GCLOUD_KEYFILE_JSON. For node application I need to implement it myself

See how it is used here for example: https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/ea2be47beb32615b2bf69f8a846a684f86c8328c/google-cloud-datastore/lib/google/cloud/datastore/credentials.rb

Activity

  1. stephenplusplus commented on Dec 2, 2016

    @stephenplusplus
    Contributor

    We do support the datastore emulator variable, and for JSON, try GOOGLE_APPLICATION_CREDENTIALS, which comes from when you authenticate using the gcloud SDK, but you can set the env var manually to point to a JSON key file. That should be supported in Ruby as well.

  2. stephenplusplus commented on Dec 2, 2016

    @stephenplusplus
    Contributor

    Going to close @timanovsky, but let me know if GOOGLE_APPLICATION_CREDENTIALS doesn't do the trick.

  3. lukewlms commented on Jun 27, 2018

    @lukewlms

    There's a solution here for using environment variables instead of an on-disk file (critical for our Heroku setup).

    You can authenticate with credentials: { private_key, client_email } rather than path to a json file.

  4. added a commit that references this issue on Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api: datastoreIssues related to the Datastore API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions