<aside> <img src="notion://custom_emoji/22cdfe26-c4cc-4a90-b9fd-de1c57a561ac/14ed7cb3-d76c-809a-8bc2-007a409b7fa6" alt="notion://custom_emoji/22cdfe26-c4cc-4a90-b9fd-de1c57a561ac/14ed7cb3-d76c-809a-8bc2-007a409b7fa6" width="40px" /> TABLE OF CONTENTS


</aside>

<aside> <img src="notion://custom_emoji/22cdfe26-c4cc-4a90-b9fd-de1c57a561ac/134d7cb3-d76c-8047-bfd3-007a2861e4d7" alt="notion://custom_emoji/22cdfe26-c4cc-4a90-b9fd-de1c57a561ac/134d7cb3-d76c-8047-bfd3-007a2861e4d7" width="40px" /> DOCS | This documentation is frequently updated to improve clarity and keep up with the latest changes in the package. Please make sure to read everything carefully to ensure a smooth installation and setup experience. If something feels unclear or doesn’t work as expected, feel free to reach out or check back for updates!

</aside>

How to Enable Gmail API and Create Google API Credentials


Step 1: Go to Google Cloud Console

Open your browser and go to: https://console.cloud.google.com/. (I’m assuming that you’ve already created a Google account and are signed in. )

Step 2: Select or Create a Project

  1. Click the project dropdown in the top-left corner (next to the Google Cloud logo).

    Screenshot 2025-04-14 at 09.38.18.png

  2. Choose an existing project, or click “New Project” to create a new one.

  3. Give it a name and click Create.

  4. After it’s created, make sure the project is selected.

Step 3: Enable APIs and Enable Gmail API Services

  1. In the top navigation bar, try to type “Gmail” and choose the Gmail API from the search results.

    Screenshot 2025-04-14 at 09.41.49.png

  2. Click the “Enable” button. This gives your project access to the Gmail API.

Screenshot 2025-04-14 at 09.44.07.png

Step 4: Create OAuth 2.0 Credentials

  1. After enabling the API, go to Credentials page

    Screenshot 2025-04-14 at 09.49.57.png

  2. Create OAuth client ID, You’ll be prompted to configure the OAuth consent screen:

— Choose application type (e.g., Web application).

— Enter a name for your credentials.

— Under Authorized redirect URIs, add your redirect URL (https://your-domain.com/mail/oauth/callback/google).

<aside> ⚠️

Important Make sure to define your Authorized redirect URI correctly. This is the URL Google will redirect to after the user grants access. This must exactly match the redirect URI used in your application, otherwise authentication will fail.

**https://your-domain.com/mail/oauth/callback/google**

</aside>

Screenshot 2025-04-14 at 09.53.09.png

You now have:

— A Google Cloud project with Gmail API enabled

OAuth 2.0 credentials ready to use in your app

Screenshot 2025-04-14 at 10.17.56.png

Step 5: Client ID & Client secret

Now we have Client ID and Client Secret, this credential we will use Installation section

Screenshot 2025-04-14 at 10.05.07.png