Salesforce Integration with Gmail Side Panel

I want to create a Gmail extension that displays Salesforce records in the side panel when I’m reading emails. I’ve been trying to build this using Google Apps Script, but I keep running into permission issues. The error message says something about needing authorization to access external URLs.

Has anyone successfully built something similar? I’m wondering if there’s a specific way to handle the authentication between Gmail and Salesforce APIs. The goal is to have customer information from Salesforce show up automatically when I open emails from those contacts.

Any guidance on the proper approach or alternative methods would be really helpful. I’m open to using different tools if Apps Script isn’t the right choice for this integration.

i had that prob too! ended up using a chrome ext instead of apps script. oauth is def easier, and once you sort out CORS, salesforce’s REST api works like a charm! def check out the manifest v3 docs, they got good examples for the api stuff!

Authorization issues in Apps Script when integrating with Salesforce are quite common due to the challenges with cross-origin requests. I faced similar problems and resolved them by implementing a middleware service, which acts as a bridge to manage authentication and data retrieval from Salesforce. Instead of making direct calls from Apps Script, it communicates with the middleware, effectively eliminating CORS-related complications and simplifying the authentication process. For this, you’ll need to configure API keys and set up OAuth2 in the middleware. I found hosting it on Google Cloud Functions effective, but other cloud platforms can also work well.