

So I will be questing the full drive scope. In our case the user is the service account, the amount of access it needs is quite high because it needs to be able to write to Google drive. Scopes are used to define the amount of access the authenticated user is granted when access the api. The second will define the scope that our application will need in order to upload files.

The first will be the location of the Json service account key file, which we downloaded earlier form Google Cloud console. I will be setting up a couple of constants in my script.
#Google drive upload install#
The googleapis package will install all the methods we will need to authorize our service account as well as access the Google drive api from Node js. In order to access the google drive api with node js we will need to install the googleapis package.

The Google apis Node js client library is one of these libraries. Google has been kind enough to create client libraries which we can use to access their apis. Remember to go to library and enabled the Google drive api after that dont forget to download a json key file. So the very the first thing we will need to do is to go to Google Cloud console and create service account credentials. We identify our application by creating a project on Google Cloud console, we set up authorization by creating service account credentials and downloading the Json Key file. In order to access Google APIs we need to identify our application, as well as in the case of accessing private user data we need to be authorized to access that private data.
