google-api-nodejs-client
google-api-nodejs-client copied to clipboard
@googleapis/youtubeAnalytics is not published on npm
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
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 @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.
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.
Pinging this as we updated our eslintrc
to lint Typescript types and including the googleapis
module has made everything very painful.
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