Building with Google OAuth 

Whether or not you wish to use Gadget's developer OAuth credentials, these credentials are only intended for quick setup in your Development environment, and should be updated before you deploy your app to Production.

If you also wish to add additional scopes, you will need to set up your own credentials as well.

Setup your own credentials 

To obtain your own Google OAuth credentials, you'll need to create a project in the Google Cloud Console and configure the OAuth consent screen. Then, you can generate OAuth client credentials (Client ID and Client Secret) for your Gadget app and enable them. Follow these steps to get started:

Create a Google Cloud Project:

  1. Go to the Google Cloud Console:
  2. Click on the project dropdown at the top of the page, and then click New Project.
  3. Follow the prompts to give your project a name. Click Create to create the project.
A screenshot of creating a project in the Google cloud console

Configure OAuth Consent Screen:

  1. In the Google Cloud Console, go to APIs & Services > OAuth consent screen.
  2. Choose the External user type and click Create.
  3. Provide a name for your application.
A screenshot of adding a name to your project
  1. Optionally, fill out other required information.
  2. Add the necessary scopes your application needs access to.
A screenshot of adding scopes in the cloud console
  1. Save the changes.

Create OAuth Client Credentials:

  1. Go to APIs & Services > Credentials.
  2. Click Create Credentials and select OAuth client ID.
  3. Choose the application type (Web application, Android, iOS, etc.).
  4. Provide the necessary details for the chosen application type, such as redirect URIs.
A screenshot of creating the client credentials
  1. Click Create to generate the OAuth client credentials (Client ID and Client Secret).
A screenshot of credentials generated

Use OAuth Client Credentials in your Gadget application:

  1. Copy the obtained Client ID and Client Secret from the Google Cloud Console access tokens on behalf of the user.
  2. Head back over to your Gadget application, navigate to the Plugins section in the Settings page and then click on the Google OAuth interface underneath Authentication methods.
  3. Paste your credentials within the Client secret and Client ID section in the appropriate input of Development or Production (dependent on your use case).
A screenshot of adding the client credentials in the env variables in Gadget