Skip to content

API key authentication doesn't work for Cloud Natural Language #2498

@anotheri

Description

@anotheri

Environment details

  • OS: Ubuntu
  • Node.js version: 8.1.4
  • npm version: 5.0.3
  • "@google-cloud/language": "^0.11.0"

Steps to reproduce

  const language = require( '@google-cloud/language' )( {
    projectId: <MY_PROJECT_ID>,
    key: <MY_API_KEY>
  } );

It throws:

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): 
Error: Could not load the default credentials. 
Browse to https://developers.google.com/accounts/docs/application-default-credentials 
for more information.

It works with credentials object and with config json file, but it fails with API key.
Please advise or fix.

Metadata

Metadata

Labels

type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions