This section walks through setting up the Gmail connector using a OAuth-enabled Google App. Anyone can do this (even without a paid Google Workspace)!
If you’re an organization with a Google Workspace, and you’d rather use a Service Account to access Gmail, it will be available soon!
Create a Google Cloud Project
Enable the Gmail API
Set up the OAuth consent screen
founders@danswer.ai
if you wish for the Danswer team to help handle issues.Set up Scopes
.../auth/gmail.readonly
for Gmail API
Set up Test users
Create Credentials
Go to the Credentials tab and select + CREATE CREDENTIALS -> OAuth client ID
Choose Web application and give it some name like DanswerConnector
Add a Authorized JavaScript origins for http://localhost:3000
(or https://<INTERNAL_DEPLOYMENT_URL>
if you have setup Danswer for production use)
Add a Authorized redirect URIs for http://localhost:3000/admin/connectors/gmail/auth/callback
(or https://<INTERNAL_DEPLOYMENT_URL>/admin/connectors/gmail/auth/callback
if you have setup Danswer for production use)
Click create and on the right hand side next to Client secret, there is an option to download the
credentials as a JSON. Download the JSON for use in the next step.
Connect
button! All Gmail emails accessible by the user who completed step (3) will now be pulled into Danswer every 10 minutes.