Implementation of the google API in Nuxt.js

Viewed 513

I'm looking to use the google API to access my mailbox in a Nuxt project. I know there are "gapi" packages but I can't seem to use them with Nuxt.

Can anyone give me any advice on how to use packages or use Google API in the best possible way? The idea is simply to be able to connect to my Google account and then request the latest unread emails.

I think I know how to do that. Guess I just don't understand how to use an external package in Nuxt.

Edit:

I tried what Thamer tells me but I'm failing with this error when I do: compile error

I tried to run npm install --save child_process fs module but nothing change

1 Answers

I ran into the same issue it was a Webpack error adding this to nuxt config solves it but you should consider the placement of the your googleapi related code so it's not called from the client-side

build: {
    /*
     ** You can extend webpack config here
     */
    extend (config, ctx) {
      config.node = {
        fs: 'empty',
        child_process: 'empty'
      }
    }
  }
Related