Create a Domain for project for console cloud google
How to Generate an OAuth 2.0 Client ID for Your Extension
This guide will walk you through creating the necessary credentials in the Google Cloud Console to allow your extension to use the Gmail API.
Step 1: Get Your Extension's ID
Before you start, you need the unique ID that Chrome has assigned to your extension.
Open Chrome and go to the extensions page:
chrome://extensions
Make sure "Developer mode" is enabled (toggle in the top-right).
Find your "Gmail AI Assistant" extension.
Copy the ID (it will be a long string of letters, like
aeblfdbeijboljppnpclcglclpdemjga
). Keep this handy.
Step 2: Create a Google Cloud Project
Go to the Google Cloud Console.
Click the project selector dropdown at the top of the page and click "New Project".
Give your project a name (e.g., "Gmail AI Assistant Project") and click "Create".
Step 3: Enable the Gmail API
Make sure your new project is selected.
In the search bar at the top, type "Gmail API" and select it from the results.
Click the "Enable" button.
Step 4: Configure the OAuth Consent Screen
This is the screen users will see when asked for permission.
From the navigation menu (☰), go to APIs & Services > Google Auth Platform.
In the left-hand menu, click on "Branding".
Choose "External" for the User Type and click "Create" (you may only need to do this the first time).
Fill in the required fields:
App name: "Gmail AI Assistant"
User support email: Your email address
Developer contact information: Your email address
Click "Save and Continue".
You will be taken to the "Data Access" page (for Scopes). You don't need to add anything here. Click "Save and Continue".
You will land on the "Audience" page (for Test Users). You also don't need to add anything here for now. Click "Save and Continue".
Review the Summary and click "Back to Dashboard".
Step 5: Create the OAuth 2.0 Client ID
This is the final step to get your key.
From the left navigation menu, click on "Clients".
Click "+ Create OAuth client".
For "Application type", select "Chrome App".
Give it a name (e.g., "Gmail Extension Credentials").
In the "Application ID" field, paste the Extension ID you copied in Step 1.
Click "Create".
Step 6: Update Your manifest.json
A popup will appear showing you your Client ID. Copy this entire value.
Open your local
manifest.json
file.Replace the placeholder
"YOUR_CLIENT_ID.apps.googleusercontent.com"
with the Client ID you just copied.Save the
manifest.json
file.Go back to
chrome://extensions
, find your extension, and click the "Reload" button.
Your extension is now fully configured! The action buttons should now trigger the Google authentication flow the first time you use them.
Comments