Q: How to setup Google integration

QuickGecko1 month ago

I would like to use the Google api integraiton in my app. How should I proceed with the implementation and deployment?

terra

Matthewadmin1 month ago

Hey

While developing you app, you can just add Google by going to Dashboard > Connections > +Add New and when you use a widget or generate an authentication URL, everything will work out of the box!

When pushing to production however, you will have to submit an application for Google API keys before you can publish your app. To do so:

  1. First, create a google cloud project (if you do not already have one)
  2. Go to Enabled APIs and services and press the button labelled +Enable API and Services and add the Fitness API and Calendar API
  3. Then navigate to APIs and Services > Credentials and press Create Credentials, and select OAuth Client ID
  4. Fill in all details related to your app, and add the following as an Authorised redirect URI: https://api.tryterra.co/v2/auth/google/oauth2
  5. You should now be able to see a Client ID and Client Secret, please contact the terra team so we can switch your keys for testing*
  6. When you wish to deploy to production, go to APIs and Services > Consent and select publish app.
  7. Then fill in all the necessary details, so that Google can review and approve your application so you can begin connecting real users!

*One thing to note, if you wish to limit the scopes requested in the Google OAuth consent screen, please contact us and provide us with the list of scopes so we can ensure your authentication URL only requests the valid scopes


QuickGecko1 month ago

Thank you, we will keep this in mind. Just to clarify, can I use Google connection without making the application (when developing and testing)?


terra

Matthewadmin1 month ago

Yes, that is correct!