Use the Node.js Google API in an Express web app. This project can be an example or a foundation for your own project.
- Download this example
- Create a project and view your credentials in your Google Developer's Console
- Create a secrets.json file using your project's credentials (example below)
- Run npm install
- Run npm start to launch your app and see it work
Here is an example secrets.json file. Copy the below code and save it to a file in the root of your project called secrets.json. Do not share the contents of this file publicly once you have put in your client_id and client_secret.
{
"web": {
"client_id": "abcdefg",
"client_secret": "1234567890",
"redirect_uris": ["https://localhost:3000/oauth2callback"],
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token"
}
}