google-api-nodejs-client icon indicating copy to clipboard operation
google-api-nodejs-client copied to clipboard

@googleapis/youtubeAnalytics is not published on npm

Open aresn opened this issue 3 years ago • 5 comments

Documentation here ->https://github.com/googleapis/google-api-nodejs-client/tree/master/src/apis/youtubeAnalytics states that this package exists. However npm install @googleapis/youtubeAnalytics results in a 404

aresn avatar Apr 28 '21 16:04 aresn

Hi @aresn! We currently don't support publishing all modules independently, only some!

In order to use youtubeAnalytics, please install the googleapis module:

npm i googleapis

Thanks!

sofisl avatar May 03 '21 17:05 sofisl

@sofisl @aresn @googleapis/youtubeAnalytics is a library we should be able to publish, I believe the root cause of it not publishing is that npm no longer allows uppercase characters in package names.

As @sofisl says, for now you should be able to use googleapis import the library, long term it would be good to address this case sensitivity issue.

bcoe avatar May 03 '21 17:05 bcoe

Adding a 👍 to this, however unhelpful, because this is the last dependency we have on googleapis, after swapping the rest over to @googleapis/thing, and this one package adds 10 seconds to our Typescript builds.

8bitDesigner avatar May 18 '22 01:05 8bitDesigner

Pinging this as we updated our eslintrc to lint Typescript types and including the googleapis module has made everything very painful.

8bitDesigner avatar Jul 11 '22 19:07 8bitDesigner

I was able to install this package using a lower case "A" in "Analytics", which I think many of you are trying to do.

npm install @googleapis/youtubeanalytics
import { youtubeAnalytics } from  @googleapis/youtubeanalytics

I have had some success in then referencing this like so:

await youtubeAnalytics({version:'v2'}).reports.query( ...
const countryReportResponse = await youtubeAnalytics({version:'v2'}).reports.query({
  startDate,
  endDate,
  ids: `channel==${channelId}`,
  metrics: 'views',
  dimensions: 'country',
  access_token: accessToken,
});
                
console.log(JSON.stringify(countryReportResponse));

This page was marginally helpful to me; Sharing in case it may point someone else in the right direction: https://googleapis.dev/nodejs/googleapis/latest/youtubeAnalytics/classes/Youtubeanalytics-1.html#reports

ttrreevvoorr avatar Mar 28 '23 22:03 ttrreevvoorr