This guide will help you deploy the SheetBrain AI add-on to your Google Sheets.
- Google Account
- Access to Google Sheets
- Backend deployed at:
https://sheetbrain-ai.vercel.app
-
Open Google Sheets
- Go to sheets.google.com
- Open an existing sheet or create a new one
-
Open Apps Script Editor
- Click
Extensions→Apps Script - This opens the script editor in a new tab
- Click
-
Copy the Main Script
- Delete any existing code in
Code.gs - Open
apps-script-standalone-code.jsfrom this repository - Copy the entire file contents
- Paste into
Code.gsin the Apps Script editor
- Delete any existing code in
-
Create the Sidebar HTML
- In Apps Script editor, click the
+next to Files - Select
HTMLfile - Name it
sidebar(without .html extension) - Delete any existing content
- Open
apps-script/src/ui/sidebar.html - Copy the entire file contents
- Paste into the
sidebar.htmlfile
- In Apps Script editor, click the
-
Save and Deploy
- Click the floppy disk icon (💾) or press
Ctrl+Sto save - Name your project:
SheetBrain AI - Click
Run→ SelectonOpenfunction - Authorize the app (see Authorization section below)
- Click the floppy disk icon (💾) or press
-
Test the Add-on
- Go back to your Google Sheet
- Refresh the page (
F5orCtrl+R) - You should see a new menu:
🧠 SheetBrain AI
# Navigate to apps-script directory
cd apps-script
# Install dependencies
pnpm install
# Build the project
pnpm build
# The output will be in dist/
# Copy dist/bundle.js content to Google Apps ScriptWhen you first run the script, Google will ask for permissions:
- Click "Review Permissions"
- Choose your Google account
- Click "Advanced" (if you see a warning)
- Click "Go to SheetBrain AI (unsafe)"
- Click "Allow" to grant permissions
Permissions Required:
- ✅ View and manage spreadsheets
- ✅ Display and run third-party web content
- ✅ Connect to an external service (SheetBrain API)
Menu: 🧠 SheetBrain AI → 📊 Audit Formulas
- Click and drag to select cells with formulas
- Or select a single cell with a formula
- The add-on will analyze all formulas in the selection
- Click the "🔍 Audit Selected Formulas" button
- Wait for analysis (usually 2-5 seconds)
Each formula will show:
- ✅ Compliance Status: Compliant or Non-Compliant
- 🎯 Risk Level: Low, Medium, or High
- 📋 Issues Found: Specific problems detected
- 💡 Recommendations: AI-powered suggestions
- 🔧 Apply Button: One-click formula fixes
Menu: 🧠 SheetBrain AI → ⚙️ Settings
- Organization ID: Your company/team identifier
- Department: Finance, HR, Operations, etc.
- Click "Save Settings"
This customizes policy enforcement for your organization.
Menu: 🧠 SheetBrain AI → 📤 Upload Policy
- Enter policy title (e.g., "Financial Reporting Guidelines")
- Enter policy content (copy-paste your policy document)
- Click OK
- Policy will be used in future audits
// In Code.gs, modify the CONFIG object:
const CONFIG = {
BACKEND_URL: 'https://your-custom-domain.com',
TIMEOUT_MS: 30000,
};// Add this function to Code.gs
function testAuth() {
try {
const token = getAuthToken();
Logger.log('Auth successful: ' + token.substring(0, 20) + '...');
} catch (error) {
Logger.log('Auth failed: ' + error.message);
}
}Run this function from the Apps Script editor to verify authentication.
// Add this function to Code.gs
function testConnection() {
const response = UrlFetchApp.fetch('https://sheetbrain-ai.vercel.app/api/health');
Logger.log('Status: ' + response.getResponseCode());
Logger.log('Response: ' + response.getContentText());
}Apps Script Editor → View → Logs (or Ctrl+Enter)
- Open your financial spreadsheet
- Select cells containing budget formulas (e.g., B2:B50)
- Click
🧠 SheetBrain AI→📊 Audit Formulas - Review results:
- ✅ 45 formulas compliant
⚠️ 3 medium risk (missing error handling)- ❌ 2 high risk (circular references)
- Click "Apply Suggestion" on high-risk formulas
- Re-run audit to verify fixes
Solution:
- Refresh the Google Sheet page
- Run
onOpen()function manually in Apps Script editor - Check browser console for errors
Solution:
- Clear stored credentials: Run
logout()function - Re-authorize the script
- Verify backend is running: Visit
https://sheetbrain-ai.vercel.app/api/health
Solution:
- Make sure cells are selected before clicking Audit
- Ensure selected cells contain formulas (start with
=)
Solution:
- Reduce selection size (audit fewer cells at once)
- Check internet connection
- Verify backend status
To update to a newer version:
- Open Apps Script editor
- Replace
Code.gscontent with new version - Replace
sidebar.htmlcontent with new version - Save and refresh your sheet
| Feature | Description | Menu Path |
|---|---|---|
| Audit Formulas | AI-powered formula analysis | 📊 Audit Formulas |
| Upload Policy | Add custom compliance policies | 📤 Upload Policy |
| Settings | Configure org ID & department | ⚙️ Settings |
| Help | Quick start guide | 📖 Help |
| Logout | Clear authentication | 🚪 Logout |
- Begin with 10-20 formulas
- Gradually increase to larger ranges
- Set department in Settings
- Upload relevant policies for your team
- Audit new formulas before sharing sheets
- Re-audit after major changes
- Review AI suggestions before applying
- Test applied formulas with sample data
- ✅ Encrypted Communication: All API calls use HTTPS
- ✅ Token-Based Auth: No passwords stored in sheets
- ✅ Minimal Permissions: Only accesses selected ranges
- ✅ No Data Storage: Formulas analyzed in real-time
- ✅ Organization Isolation: Your policies stay private
- Report issues: GitHub Issues
- Email: support@sheetbrain.ai
- Full docs: docs.sheetbrain.ai
- API reference: api.sheetbrain.ai/docs
- Discord: Join our server
- Twitter: @SheetBrainAI
MIT License - See LICENSE file
Your SheetBrain AI add-on is now ready to use. Start auditing formulas and improving your spreadsheet quality!
Next Steps:
- ✅ Select some formulas
- ✅ Click "Audit Formulas"
- ✅ Review the AI-powered insights
- ✅ Apply suggestions to improve your formulas
Happy auditing! 🧠✨