I want to sign in using google oauth, please help me

I want to sign in people using their account and save their user name , email address and id in the databse.
which scope i should use and how ? If you have done something like that plz comment the code.
Thanks in advance.

It sounds like you actually have some code already setup if your asking about scopes.

Do you have any code that can be linked and checked out? Instead of arbitrarily guessing what the code looks like and how it works? As there are a number of different approaches to getting google oauth working with any give use-case.

  1. Create a Google client ID and client secret- Use Google API console- https://console.developers.google.com/, check this link and follow steps
  2. Initialize a project with all the dependencies at node.js
  3. Writing express server code for web request acceptance
  4. Creating a Profile and Login page
    You can go through this tutorial to understand in depth- https://www.loginradius.com/engineering/blog/google-authentication-with-nodejs-and-passportjs/