examples/functions-google-gmail/README.md
Set up Google OAuth Client.
This sample uses google oAuth client to authenticate into the Google inbox api. Obtain an oAuth credential from the Google Cloud API & Services Credentials Page
http://localhost:8000Add the Google Oauth Credentials to your .env.development file
There are 2 environment variable you'll need to add to your project:
GATSBY_GOOGLE_CLIENT_ID: Fetch the ClientId from the newly created OAuth 2.0 Client ID. You can find it in the Google Credentials ConsoleYou'll also want to add these as environment variables when deploying to Gatsby Cloud.
Start developing.
To get started, run npm install to add all necessary packages.
When developing locally, you include environment variables to your .env.development. Read more about how Gatsby handles .env files and environment variables in the Gatsby Docs
cd examples/functions-google-gmail
npm install
npm run develop
Open the code and start customizing!
Your site is now running at http://localhost:8000! You can use the UI on the index page to test the functions or directly access them at http://localhost:8000/api/{function_name}
Edit src/pages/index.js to see your site update in real-time!
Deploy
You can deploy this example on Gatsby Cloud by copying the example into a new repo and connecting that to Gatsby Cloud.