I'm using Google's APIs Client Library for PHP to enable a Sign In With Google Button and using Composer to install the dependencies.
The client library readme states:
There are over 200 Google API services. The chances are good that you will not want them all. In order to avoid shipping these dependencies with your code, you can run the Google\Task\Composer::cleanup task and specify the services you want to keep in composer.json:
Which services do I need to keep to enable just the authentication functionality of the button?
Edit: To be clear, the button functionality works well, but I'm including 60MB of services like YouTube and Analytics that I don't need, so I'm looking for what I need to add in my composer.json to exclude those services from the build.
After some tinkering, adding the below scripts
and extra
key removes all other services leaving just 3 folders in the /vendor folder:
apiclient
, apiclient-services
, and auth
. All others are removed on build.
{
"require": {
"google/apiclient": "^2.15.0"
},
"scripts": {
"pre-autoload-dump": "Google\\Task\\Composer::cleanup"
},
"extra": {
"google/apiclient-services": [ "" ]
}
}