Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set an user-agent? #1802

Closed
oliverjessner opened this issue Aug 28, 2019 · 3 comments
Closed

How to set an user-agent? #1802

oliverjessner opened this issue Aug 28, 2019 · 3 comments
Assignees
Labels
type: question Request for information or clarification. Not an issue.

Comments

@oliverjessner
Copy link

oliverjessner commented Aug 28, 2019

As far as I understand, there is a way implemented to set the user-agent.
But I didn't found any documentation/comment which explains how I add the user-agent.

#1468

@bcoe bcoe added the type: question Request for information or clarification. Not an issue. label Aug 28, 2019
@oliverjessner oliverjessner changed the title How to set a user-agent? How to set an user-agent? Sep 2, 2019
@oliverjessner
Copy link
Author

friendly pump

@bcoe
Copy link
Contributor

bcoe commented Sep 30, 2019

@oliverjessner I believe you should be able to do something along the lines of:

const {google} = require('googleapis');
google.options({
  userAgentDirectives: [{product: 'frog', version: '1.0', comment: 'jumps'}]
});
const blogger = google.blogger({
  version: 'v3',
  // All requests made with this service client will contain the
  // blogId query parameter unless overridden in individual API calls.
  params: {
    blogId: 3213900
  }
});

☝️ global configuration options should be applied to each client.

@crwilcox
Copy link

crwilcox commented Dec 6, 2019

Since we haven't heard anything I am going to close this and assume @bcoe sample above will work for your use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants