question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Globally set API KEY

See original GitHub issue

Would be nice to have a way to set the API KEY on the API level and not only on the REQUEST level.

Something like:

require('googleapis')
  .discover('youtube', 'v3')
  .withApiKey('YOUR_KEY');

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ryanseyscommented, Jul 22, 2014

Fixed in 1.0.0. Set a global API KEY just like this:

var google = require('googleapis');
google.options({ auth: 'API KEY HERE' });

or even on the service level if that suits your fancy:

var google = require('googleapis');
var youtube = google.youtube({ version: 'v3', auth: 'API KEY HERE' });
// ...
0reactions
ryanseyscommented, Jul 22, 2014

😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set up API keys using the API Gateway console
Choose a REST API. · In the API Gateway main navigation pane, choose API Keys. · From the Actions drop-down menu, choose Create...
Read more >
Authenticate using API keys - Google Cloud
API -first integration to connect existing data and applications. ... Solution to bridge existing care systems and apps on Google Cloud. ... No-code...
Read more >
Create One Global API Key - MongoDB
List of roles that the Global API Key needs to have. If the roles array is provided: Provide at least one role; Make...
Read more >
API Keys - Swagger
Some APIs use a pair of security keys, say, API Key and App ID. To specify that the keys are used together (as...
Read more >
Use API Keys | Maps JavaScript API - Google Developers
Restrict API keys · Go to the Google Maps Platform > Credentials page. Go to the Credentials page · Select the API key...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found